LCOV - code coverage report
Current view: top level - EnergyPlus - SizingManager.cc (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 75.1 % 3335 2506
Test Date: 2025-06-02 07:23:51 Functions: 100.0 % 24 24

            Line data    Source code
       1              : // EnergyPlus, Copyright (c) 1996-2025, The Board of Trustees of the University of Illinois,
       2              : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
       3              : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
       4              : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
       5              : // contributors. All rights reserved.
       6              : //
       7              : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
       8              : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
       9              : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
      10              : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
      11              : // derivative works, and perform publicly and display publicly, and to permit others to do so.
      12              : //
      13              : // Redistribution and use in source and binary forms, with or without modification, are permitted
      14              : // provided that the following conditions are met:
      15              : //
      16              : // (1) Redistributions of source code must retain the above copyright notice, this list of
      17              : //     conditions and the following disclaimer.
      18              : //
      19              : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
      20              : //     conditions and the following disclaimer in the documentation and/or other materials
      21              : //     provided with the distribution.
      22              : //
      23              : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
      24              : //     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
      25              : //     used to endorse or promote products derived from this software without specific prior
      26              : //     written permission.
      27              : //
      28              : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
      29              : //     without changes from the version obtained under this License, or (ii) Licensee makes a
      30              : //     reference solely to the software portion of its product, Licensee must refer to the
      31              : //     software as "EnergyPlus version X" software, where "X" is the version number Licensee
      32              : //     obtained under this License and may not use a different name for the software. Except as
      33              : //     specifically required in this Section (4), Licensee shall not use in a company name, a
      34              : //     product name, in advertising, publicity, or other promotional activities any name, trade
      35              : //     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
      36              : //     similar designation, without the U.S. Department of Energy's prior written consent.
      37              : //
      38              : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
      39              : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
      40              : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      41              : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      42              : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      43              : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      44              : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      45              : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      46              : // POSSIBILITY OF SUCH DAMAGE.
      47              : 
      48              : // C++ Headers
      49              : #include <cmath>
      50              : #include <string>
      51              : 
      52              : // EnergyPlus Headers
      53              : #include <EnergyPlus/Autosizing/Base.hh>
      54              : #include <EnergyPlus/Data/EnergyPlusData.hh>
      55              : #include <EnergyPlus/DataDefineEquip.hh>
      56              : #include <EnergyPlus/DataEnvironment.hh>
      57              : #include <EnergyPlus/DataGlobalConstants.hh>
      58              : #include <EnergyPlus/DataHVACGlobals.hh>
      59              : #include <EnergyPlus/DataHeatBalance.hh>
      60              : #include <EnergyPlus/DataIPShortCuts.hh>
      61              : #include <EnergyPlus/DataSizing.hh>
      62              : #include <EnergyPlus/DataStringGlobals.hh>
      63              : #include <EnergyPlus/DataZoneEquipment.hh>
      64              : #include <EnergyPlus/DisplayRoutines.hh>
      65              : #include <EnergyPlus/DualDuct.hh>
      66              : #include <EnergyPlus/EMSManager.hh>
      67              : #include <EnergyPlus/General.hh>
      68              : #include <EnergyPlus/HVACCooledBeam.hh>
      69              : #include <EnergyPlus/HVACSingleDuctInduc.hh>
      70              : #include <EnergyPlus/HeatBalanceManager.hh>
      71              : #include <EnergyPlus/InputProcessing/InputProcessor.hh>
      72              : #include <EnergyPlus/OutputReportPredefined.hh>
      73              : #include <EnergyPlus/OutputReportTabular.hh>
      74              : #include <EnergyPlus/PoweredInductionUnits.hh>
      75              : #include <EnergyPlus/SQLiteProcedures.hh>
      76              : #include <EnergyPlus/ScheduleManager.hh>
      77              : #include <EnergyPlus/SimAirServingZones.hh>
      78              : #include <EnergyPlus/SingleDuct.hh>
      79              : #include <EnergyPlus/SizingManager.hh>
      80              : #include <EnergyPlus/UtilityRoutines.hh>
      81              : #include <EnergyPlus/WeatherManager.hh>
      82              : #include <EnergyPlus/ZoneEquipmentManager.hh>
      83              : 
      84              : namespace EnergyPlus::SizingManager {
      85              : 
      86              : // MODULE INFORMATION:
      87              : //       AUTHOR         Fred Buhl
      88              : //       DATE WRITTEN   December 2000
      89              : 
      90              : // PURPOSE OF THIS MODULE:
      91              : // This module contains the data and routines relating to managing the sizing simulations.
      92              : 
      93              : // Using/Aliasing
      94              : using namespace HeatBalanceManager;
      95              : using namespace DataSizing;
      96              : using DataStringGlobals::CharComma;
      97              : using DataStringGlobals::CharSpace;
      98              : using DataStringGlobals::CharTab;
      99              : 
     100              : constexpr std::array<std::string_view, (int)DataSizing::OAFlowCalcMethod::Num> OAFlowCalcMethodNamesUC{"FLOW/PERSON",
     101              :                                                                                                        "FLOW/ZONE",
     102              :                                                                                                        "FLOW/AREA",
     103              :                                                                                                        "AIRCHANGES/HOUR",
     104              :                                                                                                        "SUM",
     105              :                                                                                                        "MAXIMUM",
     106              :                                                                                                        "INDOORAIRQUALITYPROCEDURE",
     107              :                                                                                                        "PROPORTIONALCONTROLBASEDONOCCUPANCYSCHEDULE",
     108              :                                                                                                        "PROPORTIONALCONTROLBASEDONDESIGNOCCUPANCY"};
     109              : 
     110          801 : void ManageSizing(EnergyPlusData &state)
     111              : {
     112              : 
     113              :     // SUBROUTINE INFORMATION:
     114              :     //       AUTHOR         Fred Buhl
     115              :     //       DATE WRITTEN   December 2000
     116              : 
     117              :     // PURPOSE OF THIS SUBROUTINE:
     118              :     // This subroutine manages the sizing simulations (using design day conditions)
     119              :     // for zones, central air systems, and central plants and zone heating and cooling
     120              : 
     121              :     // METHODOLOGY EMPLOYED:
     122              :     // Design day simulations are run with the zones supplied with "Ideal Loads",
     123              :     // yielding zone design supply air flow rates and zone heating and cooling capacities.
     124              :     // Design day simulations are run again with central air systems supplied by
     125              :     // purchased hot and cold water, yielding central heating and cooling capacities.
     126              : 
     127              :     // Using/Aliasing
     128              :     using SimAirServingZones::ManageAirLoops;
     129              :     using SimAirServingZones::UpdateSysSizing;
     130              :     using ZoneEquipmentManager::ManageZoneEquipment;
     131              :     using ZoneEquipmentManager::RezeroZoneSizingArrays;
     132              :     using ZoneEquipmentManager::UpdateZoneSizing;
     133              :     using namespace OutputReportPredefined;
     134              : 
     135              :     using OutputReportTabular::AllocateLoadComponentArrays;
     136              :     using OutputReportTabular::ComputeLoadComponentDecayCurve;
     137              :     using OutputReportTabular::DeallocateLoadComponentArrays;
     138              :     using OutputReportTabular::hasSizingPeriodsDays;
     139              :     using OutputReportTabular::isCompLoadRepReq;
     140              : 
     141              :     // SUBROUTINE PARAMETER DEFINITIONS:
     142              :     static constexpr std::string_view RoutineName("ManageSizing: ");
     143              : 
     144              :     // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
     145          801 :     bool Available(false); // an environment is available to process
     146          801 :     bool ErrorsFound(false);
     147          801 :     bool SimAir(false);
     148          801 :     bool SimZoneEquip(false);
     149          801 :     int TimeStepInDay(0); // time step number
     150          801 :     int LastMonth(0);
     151          801 :     int LastDayOfMonth(0);
     152          801 :     std::string curName;
     153              :     int NumSizingPeriodsPerformed;
     154              :     int numZoneSizeIter; // number of times to repeat zone sizing calcs. 1 normal, 2 load component reporting
     155              :     bool isUserReqCompLoadReport;
     156              : 
     157          801 :     TimeStepInDay = 0;
     158          801 :     state.dataSize->SysSizingRunDone = false;
     159          801 :     state.dataSize->ZoneSizingRunDone = false;
     160          801 :     curName = "Unknown";
     161          801 :     GetOARequirements(state);      // get the OA requirements object
     162          801 :     GetZoneAirDistribution(state); // get zone air distribution objects
     163          801 :     GetZoneHVACSizing(state);      // get zone HVAC sizing object
     164          801 :     GetAirTerminalSizing(state);   // get air terminal sizing object
     165          801 :     GetSizingParams(state);        // get the building level sizing parameters
     166          801 :     GetZoneSizingInput(state);     // get the Zone Sizing input
     167          801 :     GetSystemSizingInput(state);   // get the System Sizing input
     168          801 :     GetPlantSizingInput(state);    // get the Plant Sizing input
     169              : 
     170              :     // okay, check sizing inputs vs desires vs requirements
     171          801 :     if (state.dataGlobal->DoZoneSizing || state.dataGlobal->DoSystemSizing) {
     172          862 :         if ((state.dataSize->NumSysSizInput > 0 && state.dataSize->NumZoneSizingInput == 0) ||
     173          431 :             (!state.dataGlobal->DoZoneSizing && state.dataGlobal->DoSystemSizing && state.dataSize->NumSysSizInput > 0)) {
     174            0 :             ShowSevereError(state, format("{}Requested System Sizing but did not request Zone Sizing.", RoutineName));
     175            0 :             ShowContinueError(state, "System Sizing cannot be done without Zone Sizing");
     176            0 :             ShowFatalError(state, "Program terminates for preceding conditions.");
     177              :         }
     178              :     }
     179              : 
     180              :     // determine if the second set of zone sizing calculations should be performed
     181              :     // that include a pulse for the load component reporting
     182          801 :     isUserReqCompLoadReport = isCompLoadRepReq(state); // check getinput structure if load component report is requested
     183              :     bool fileHasSizingPeriodDays =
     184          801 :         hasSizingPeriodsDays(state); // check getinput if SizingPeriod:DesignDays or SizingPeriod:WeatherFileDays are present
     185          801 :     if (state.dataGlobal->DoZoneSizing && (state.dataSize->NumZoneSizingInput > 0) && fileHasSizingPeriodDays) {
     186          428 :         state.dataGlobal->CompLoadReportIsReq = isUserReqCompLoadReport;
     187              :     } else { // produce a warning if the user asked for the report but it will not be generated because sizing is not done
     188          373 :         if (isUserReqCompLoadReport) {
     189            0 :             if (fileHasSizingPeriodDays) {
     190            0 :                 ShowWarningError(
     191              :                     state,
     192            0 :                     format("{}The ZoneComponentLoadSummary report was requested but no sizing objects were found so that report cannot be generated.",
     193              :                            RoutineName));
     194              :             } else {
     195            0 :                 ShowWarningError(state,
     196            0 :                                  format("{}The ZoneComponentLoadSummary report was requested but no SizingPeriod:DesignDay or "
     197              :                                         "SizingPeriod:WeatherFileDays objects were found so that report cannot be generated.",
     198              :                                         RoutineName));
     199              :             }
     200              :         }
     201              :     }
     202          801 :     if (state.dataGlobal->CompLoadReportIsReq) { // if that report is created then zone sizing calculations are repeated
     203           27 :         numZoneSizeIter = 2;
     204              :     } else {
     205          774 :         numZoneSizeIter = 1;
     206              :     }
     207              : 
     208          801 :     if ((state.dataGlobal->DoZoneSizing) && (state.dataSize->NumZoneSizingInput == 0)) {
     209            4 :         ShowWarningError(
     210              :             state,
     211            4 :             format("{}For a zone sizing run, there must be at least 1 Sizing:Zone input object. SimulationControl Zone Sizing option ignored.",
     212              :                    RoutineName));
     213              :     }
     214              : 
     215         1243 :     if ((state.dataSize->NumZoneSizingInput > 0) &&
     216          442 :         (state.dataGlobal->DoZoneSizing || state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing)) {
     217              : 
     218          428 :         state.dataGlobal->DoOutputReporting = false;
     219          428 :         state.dataGlobal->ZoneSizingCalc = true;
     220          428 :         Available = true;
     221              : 
     222          856 :         ShowMessage(state, "Beginning Zone Sizing Calculations");
     223              : 
     224          428 :         Weather::ResetEnvironmentCounter(state);
     225          428 :         state.dataGlobal->KickOffSizing = true;
     226          428 :         SetupZoneSizing(state, ErrorsFound); // Should only be done ONCE
     227          428 :         state.dataGlobal->KickOffSizing = false;
     228              : 
     229          883 :         for (int iZoneCalcIter = 1; iZoneCalcIter <= numZoneSizeIter; ++iZoneCalcIter) { // normally this is performed once but if load component
     230              :             // report is requested, these are repeated with a pulse in
     231              :             // each zone.
     232              : 
     233              :             // set flag if performing a "pulse" set of sizing calcs
     234              :             // the pulse simulation needs to be done first (the 1 in the following line) otherwise
     235              :             // the difference seen in the loads in the epluspls and epluszsz files are not
     236              :             // simple decreasing curves but appear as amost random fluctuations.
     237          455 :             state.dataGlobal->isPulseZoneSizing = (state.dataGlobal->CompLoadReportIsReq && (iZoneCalcIter == 1));
     238          455 :             if (state.dataGlobal->DoPureLoadCalc && !state.dataGlobal->isPulseZoneSizing) {
     239            0 :                 state.dataGlobal->DoOutputReporting = true;
     240              :             }
     241              : 
     242          455 :             Available = true;
     243              : 
     244          455 :             Weather::ResetEnvironmentCounter(state);
     245          455 :             state.dataSize->CurOverallSimDay = 0;
     246          455 :             NumSizingPeriodsPerformed = 0;
     247         1395 :             while (Available) { // loop over environments
     248              : 
     249         1395 :                 Weather::GetNextEnvironment(state, Available, ErrorsFound); // get an environment
     250              : 
     251         1395 :                 if (!Available) {
     252          455 :                     break;
     253              :                 }
     254          940 :                 if (ErrorsFound) {
     255            0 :                     break;
     256              :                 }
     257              : 
     258              :                 // check that environment is one of the design days
     259          940 :                 if (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) {
     260            0 :                     continue;
     261              :                 }
     262              : 
     263          940 :                 ++NumSizingPeriodsPerformed;
     264              : 
     265          940 :                 if (state.dataGlobal->DoPureLoadCalc && !state.dataGlobal->isPulseZoneSizing) {
     266            0 :                     if (state.dataSQLiteProcedures->sqlite) {
     267            0 :                         state.dataSQLiteProcedures->sqlite->sqliteBegin();
     268            0 :                         state.dataSQLiteProcedures->sqlite->createSQLiteEnvironmentPeriodRecord(
     269            0 :                             state.dataEnvrn->CurEnvirNum, state.dataEnvrn->EnvironmentName, state.dataGlobal->KindOfSim);
     270            0 :                         state.dataSQLiteProcedures->sqlite->sqliteCommit();
     271              :                     }
     272              :                 }
     273              : 
     274          940 :                 state.dataGlobal->BeginEnvrnFlag = true;
     275          940 :                 state.dataGlobal->EndEnvrnFlag = false;
     276          940 :                 state.dataEnvrn->EndMonthFlag = false;
     277          940 :                 state.dataGlobal->WarmupFlag = true;
     278          940 :                 state.dataGlobal->DayOfSim = 0;
     279          940 :                 state.dataGlobal->DayOfSimChr = "0";
     280          940 :                 state.dataSize->CurEnvirNumSimDay = 1;
     281          940 :                 ++state.dataSize->CurOverallSimDay;
     282         8576 :                 while ((state.dataGlobal->DayOfSim < state.dataGlobal->NumOfDayInEnvrn) || (state.dataGlobal->WarmupFlag)) { // Begin day loop ...
     283              : 
     284         6696 :                     ++state.dataGlobal->DayOfSim;
     285         6696 :                     if (!state.dataGlobal->WarmupFlag && state.dataGlobal->DayOfSim > 1) {
     286           33 :                         ++state.dataSize->CurEnvirNumSimDay;
     287              :                     }
     288              : 
     289         6696 :                     state.dataGlobal->DayOfSimChr = fmt::to_string(state.dataGlobal->DayOfSim);
     290         6696 :                     state.dataGlobal->BeginDayFlag = true;
     291         6696 :                     state.dataGlobal->EndDayFlag = false;
     292              : 
     293         6696 :                     if (state.dataGlobal->WarmupFlag) {
     294         5723 :                         DisplayString(state, "Warming up");
     295              :                     } else { // (.NOT.WarmupFlag)
     296          973 :                         if (state.dataGlobal->DayOfSim == 1) {
     297          940 :                             if (!state.dataGlobal->isPulseZoneSizing) {
     298          886 :                                 DisplayString(state, "Performing Zone Sizing Simulation");
     299              :                             } else {
     300           54 :                                 DisplayString(state, "Performing Zone Sizing Simulation for Load Component Report");
     301              :                             }
     302          940 :                             DisplayString(state,
     303         1880 :                                           fmt::format("...for Sizing Period: #{} {}", NumSizingPeriodsPerformed, state.dataEnvrn->EnvironmentName));
     304              :                         }
     305          973 :                         UpdateZoneSizing(state, Constant::CallIndicator::BeginDay);
     306          973 :                         UpdateFacilitySizing(state, Constant::CallIndicator::BeginDay);
     307              :                     }
     308              : 
     309       167400 :                     for (state.dataGlobal->HourOfDay = 1; state.dataGlobal->HourOfDay <= Constant::iHoursInDay;
     310       160704 :                          ++state.dataGlobal->HourOfDay) { // Begin hour loop ...
     311              : 
     312       160704 :                         state.dataGlobal->BeginHourFlag = true;
     313       160704 :                         state.dataGlobal->EndHourFlag = false;
     314              : 
     315       988368 :                         for (state.dataGlobal->TimeStep = 1; state.dataGlobal->TimeStep <= state.dataGlobal->TimeStepsInHour;
     316       827664 :                              ++state.dataGlobal->TimeStep) { // Begin time step (TINC) loop ...
     317              : 
     318       827664 :                             state.dataGlobal->BeginTimeStepFlag = true;
     319              : 
     320              :                             // Set the End__Flag variables to true if necessary.  Note that
     321              :                             // each flag builds on the previous level.  EndDayFlag cannot be
     322              :                             // .TRUE. unless EndHourFlag is also .TRUE., etc.  Note that the
     323              :                             // EndEnvrnFlag and the EndSimFlag cannot be set during warmup.
     324              :                             // Note also that BeginTimeStepFlag, EndTimeStepFlag, and the
     325              :                             // SubTimeStepFlags can/will be set/reset in the HVAC Manager.
     326              : 
     327       827664 :                             if (state.dataGlobal->TimeStep == state.dataGlobal->TimeStepsInHour) {
     328       160704 :                                 state.dataGlobal->EndHourFlag = true;
     329       160704 :                                 if (state.dataGlobal->HourOfDay == Constant::iHoursInDay) {
     330         6696 :                                     state.dataGlobal->EndDayFlag = true;
     331         6696 :                                     if ((!state.dataGlobal->WarmupFlag) && (state.dataGlobal->DayOfSim == state.dataGlobal->NumOfDayInEnvrn)) {
     332          940 :                                         state.dataGlobal->EndEnvrnFlag = true;
     333              :                                     }
     334              :                                 }
     335              :                             }
     336              : 
     337              :                             // set flag for pulse used in load component reporting
     338       827664 :                             state.dataGlobal->doLoadComponentPulseNow = CalcdoLoadComponentPulseNow(state,
     339       827664 :                                                                                                     state.dataGlobal->isPulseZoneSizing,
     340       827664 :                                                                                                     state.dataGlobal->WarmupFlag,
     341       827664 :                                                                                                     state.dataGlobal->HourOfDay,
     342       827664 :                                                                                                     state.dataGlobal->TimeStep,
     343       827664 :                                                                                                     state.dataGlobal->KindOfSim);
     344              : 
     345       827664 :                             Weather::ManageWeather(state);
     346              : 
     347       827664 :                             if (!state.dataGlobal->WarmupFlag) {
     348       120912 :                                 TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->TimeStepsInHour + state.dataGlobal->TimeStep;
     349       120912 :                                 if (state.dataGlobal->HourOfDay == 1 && state.dataGlobal->TimeStep == 1) {
     350          973 :                                     state.dataSize->DesDayWeath(state.dataSize->CurOverallSimDay).DateString =
     351         2919 :                                         fmt::format("{}/{}", state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth);
     352              :                                 }
     353       120912 :                                 state.dataSize->DesDayWeath(state.dataSize->CurOverallSimDay).Temp(TimeStepInDay) = state.dataEnvrn->OutDryBulbTemp;
     354       120912 :                                 state.dataSize->DesDayWeath(state.dataSize->CurOverallSimDay).HumRat(TimeStepInDay) = state.dataEnvrn->OutHumRat;
     355       120912 :                                 state.dataSize->DesDayWeath(state.dataSize->CurOverallSimDay).Press(TimeStepInDay) = state.dataEnvrn->OutBaroPress;
     356              :                             }
     357              : 
     358       827664 :                             ManageHeatBalance(state);
     359              : 
     360       827664 :                             state.dataGlobal->BeginHourFlag = false;
     361       827664 :                             state.dataGlobal->BeginDayFlag = false;
     362       827664 :                             state.dataGlobal->BeginEnvrnFlag = false;
     363       827664 :                             state.dataGlobal->BeginSimFlag = false;
     364              : 
     365              :                         } // ... End time step (TINC) loop.
     366              : 
     367       160704 :                         state.dataGlobal->PreviousHour = state.dataGlobal->HourOfDay;
     368              : 
     369              :                     } // ... End hour loop.
     370              : 
     371         6696 :                     if (state.dataGlobal->EndDayFlag && !state.dataGlobal->WarmupFlag) {
     372         1913 :                         UpdateZoneSizing(state, Constant::CallIndicator::EndDay);
     373         1913 :                         UpdateFacilitySizing(state, Constant::CallIndicator::EndDay);
     374              :                     }
     375              : 
     376         7669 :                     if (!state.dataGlobal->WarmupFlag && (state.dataGlobal->DayOfSim > 0) &&
     377          973 :                         (state.dataGlobal->DayOfSim < state.dataGlobal->NumOfDayInEnvrn)) {
     378           33 :                         ++state.dataSize->CurOverallSimDay;
     379              :                     }
     380              : 
     381              :                 } // ... End day loop.
     382              : 
     383          940 :                 LastMonth = state.dataEnvrn->Month;
     384          940 :                 LastDayOfMonth = state.dataEnvrn->DayOfMonth;
     385              : 
     386              :             } // ... End environment loop
     387              : 
     388          455 :             if (NumSizingPeriodsPerformed > 0) {
     389          455 :                 UpdateZoneSizing(state, Constant::CallIndicator::EndZoneSizingCalc);
     390          455 :                 UpdateFacilitySizing(state, Constant::CallIndicator::EndZoneSizingCalc);
     391          455 :                 state.dataSize->ZoneSizingRunDone = true;
     392              :             } else {
     393            0 :                 ShowSevereError(state, format("{}No Sizing periods were performed for Zone Sizing. No Zone Sizing calculations saved.", RoutineName));
     394            0 :                 ErrorsFound = true;
     395              :             }
     396              : 
     397          455 :             if (state.dataGlobal->isPulseZoneSizing && state.dataSizingManager->runZeroingOnce) {
     398           27 :                 RezeroZoneSizingArrays(state); // zero all arrays related to zone sizing.
     399           27 :                 state.dataSizingManager->runZeroingOnce = false;
     400              :             }
     401              :         } // loop that repeats the zone sizing calcs for the load component report, if requested
     402              : 
     403              :         // both the pulse and normal zone sizing is complete so now post processing of the results is performed
     404          428 :         if (state.dataGlobal->CompLoadReportIsReq) {
     405              :             // call the routine that computes the decay curve
     406           27 :             ComputeLoadComponentDecayCurve(state);
     407              :             // remove some of the arrays used to derive the decay curves
     408           27 :             DeallocateLoadComponentArrays(state);
     409              :         }
     410              :     }
     411              : 
     412          801 :     state.dataGlobal->ZoneSizingCalc = false;
     413          801 :     state.dataGlobal->DoOutputReporting = false;
     414          801 :     state.dataEnvrn->Month = LastMonth;
     415          801 :     state.dataEnvrn->DayOfMonth = LastDayOfMonth;
     416              : 
     417          801 :     if ((state.dataGlobal->DoSystemSizing) && (state.dataSize->NumSysSizInput == 0) && (state.dataSizingManager->NumAirLoops > 0)) {
     418            4 :         ShowWarningError(
     419              :             state,
     420            4 :             format("{}For a system sizing run, there must be at least 1 Sizing:System object input. SimulationControl System Sizing option ignored.",
     421              :                    RoutineName));
     422              :     }
     423              : 
     424          801 :     if ((state.dataSize->NumSysSizInput > 0) && (state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing) && !ErrorsFound) {
     425              : 
     426          696 :         ShowMessage(state, "Beginning System Sizing Calculations");
     427              : 
     428          348 :         state.dataGlobal->SysSizingCalc = true;
     429          348 :         Available = true;
     430          348 :         if (state.dataSize->SizingFileColSep == CharComma) {
     431          348 :             state.files.ssz.filePath = state.files.outputSszCsvFilePath;
     432            0 :         } else if (state.dataSize->SizingFileColSep == CharTab) {
     433            0 :             state.files.ssz.filePath = state.files.outputSszTabFilePath;
     434              :         } else {
     435            0 :             state.files.ssz.filePath = state.files.outputSszTxtFilePath;
     436              :         }
     437          696 :         state.files.ssz.ensure_open(state, "ManageSizing", state.files.outputControl.ssz);
     438              : 
     439          348 :         SimAir = true;
     440          348 :         SimZoneEquip = true;
     441              : 
     442          348 :         ManageZoneEquipment(state, true, SimZoneEquip, SimAir);
     443          348 :         ManageAirLoops(state, true, SimAir, SimZoneEquip);
     444          347 :         SizingManager::UpdateTermUnitFinalZoneSizing(state); // AirDistUnits have been loaded now so TermUnitSizing values are all in place
     445          347 :         SimAirServingZones::SizeSysOutdoorAir(state);        // System OA can be sized now that TermUnitFinalZoneSizing is initialized
     446          347 :         Weather::ResetEnvironmentCounter(state);
     447          347 :         state.dataSize->CurEnvirNumSimDay = 0;
     448          347 :         state.dataSize->CurOverallSimDay = 0;
     449          347 :         NumSizingPeriodsPerformed = 0;
     450         1414 :         while (Available) { // loop over environments
     451              : 
     452         1068 :             Weather::GetNextEnvironment(state, Available, ErrorsFound); // get an environment
     453              : 
     454              :             // check that environment is one of the design days
     455         1068 :             if (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) {
     456          346 :                 continue;
     457              :             }
     458              : 
     459          722 :             if (!Available) {
     460            1 :                 break;
     461              :             }
     462          721 :             if (ErrorsFound) {
     463            0 :                 break;
     464              :             }
     465              : 
     466          721 :             ++NumSizingPeriodsPerformed;
     467              : 
     468          721 :             state.dataGlobal->BeginEnvrnFlag = true;
     469          721 :             state.dataGlobal->EndEnvrnFlag = false;
     470          721 :             state.dataGlobal->WarmupFlag = false;
     471          721 :             state.dataGlobal->DayOfSim = 0;
     472          721 :             state.dataGlobal->DayOfSimChr = "0";
     473          721 :             state.dataSize->CurEnvirNumSimDay = 1;
     474          721 :             ++state.dataSize->CurOverallSimDay;
     475              : 
     476         2175 :             while ((state.dataGlobal->DayOfSim < state.dataGlobal->NumOfDayInEnvrn) || (state.dataGlobal->WarmupFlag)) { // Begin day loop ...
     477              : 
     478          733 :                 ++state.dataGlobal->DayOfSim;
     479          733 :                 if (!state.dataGlobal->WarmupFlag && state.dataGlobal->DayOfSim > 1) {
     480           12 :                     ++state.dataSize->CurEnvirNumSimDay;
     481              :                 }
     482          733 :                 state.dataGlobal->DayOfSimChr = fmt::to_string(state.dataGlobal->DayOfSim);
     483          733 :                 state.dataGlobal->BeginDayFlag = true;
     484          733 :                 state.dataGlobal->EndDayFlag = false;
     485              : 
     486          733 :                 if (state.dataGlobal->WarmupFlag) {
     487            0 :                     DisplayString(state, "Warming up");
     488              :                 } else { // (.NOT.WarmupFlag)
     489          733 :                     if (state.dataGlobal->DayOfSim == 1) {
     490          721 :                         DisplayString(state, "Calculating System sizing");
     491          721 :                         DisplayString(state,
     492         1442 :                                       fmt::format("...for Sizing Period: #{} {}", NumSizingPeriodsPerformed, state.dataEnvrn->EnvironmentName));
     493              :                     }
     494          733 :                     UpdateSysSizing(state, Constant::CallIndicator::BeginDay);
     495              :                 }
     496              : 
     497        18325 :                 for (state.dataGlobal->HourOfDay = 1; state.dataGlobal->HourOfDay <= Constant::iHoursInDay;
     498        17592 :                      ++state.dataGlobal->HourOfDay) { // Begin hour loop ...
     499              : 
     500        17592 :                     state.dataGlobal->BeginHourFlag = true;
     501        17592 :                     state.dataGlobal->EndHourFlag = false;
     502              : 
     503       105960 :                     for (state.dataGlobal->TimeStep = 1; state.dataGlobal->TimeStep <= state.dataGlobal->TimeStepsInHour;
     504        88368 :                          ++state.dataGlobal->TimeStep) { // Begin time step (TINC) loop ...
     505              : 
     506        88368 :                         state.dataGlobal->BeginTimeStepFlag = true;
     507              : 
     508              :                         // Set the End__Flag variables to true if necessary.  Note that
     509              :                         // each flag builds on the previous level.  EndDayFlag cannot be
     510              :                         // .TRUE. unless EndHourFlag is also .TRUE., etc.  Note that the
     511              :                         // EndEnvrnFlag and the EndSimFlag cannot be set during warmup.
     512              : 
     513        88368 :                         if (state.dataGlobal->TimeStep == state.dataGlobal->TimeStepsInHour) {
     514        17592 :                             state.dataGlobal->EndHourFlag = true;
     515        17592 :                             if (state.dataGlobal->HourOfDay == Constant::iHoursInDay) {
     516          733 :                                 state.dataGlobal->EndDayFlag = true;
     517          733 :                                 if ((!state.dataGlobal->WarmupFlag) && (state.dataGlobal->DayOfSim == state.dataGlobal->NumOfDayInEnvrn)) {
     518          721 :                                     state.dataGlobal->EndEnvrnFlag = true;
     519              :                                 }
     520              :                             }
     521              :                         }
     522              : 
     523        88368 :                         Weather::ManageWeather(state);
     524              : 
     525        88368 :                         UpdateSysSizing(state, Constant::CallIndicator::DuringDay);
     526              : 
     527        88368 :                         state.dataGlobal->BeginHourFlag = false;
     528        88368 :                         state.dataGlobal->BeginDayFlag = false;
     529        88368 :                         state.dataGlobal->BeginEnvrnFlag = false;
     530              : 
     531              :                     } // ... End time step (TINC) loop.
     532              : 
     533        17592 :                     state.dataGlobal->PreviousHour = state.dataGlobal->HourOfDay;
     534              : 
     535              :                 } // ... End hour loop.
     536              : 
     537          733 :                 if (state.dataGlobal->EndDayFlag) {
     538          733 :                     UpdateSysSizing(state, Constant::CallIndicator::EndDay);
     539              :                 }
     540              : 
     541         1466 :                 if (!state.dataGlobal->WarmupFlag && (state.dataGlobal->DayOfSim > 0) &&
     542          733 :                     (state.dataGlobal->DayOfSim < state.dataGlobal->NumOfDayInEnvrn)) {
     543           12 :                     ++state.dataSize->CurOverallSimDay;
     544              :                 }
     545              : 
     546              :             } // ... End day loop.
     547              : 
     548              :         } // ... End environment loop
     549              : 
     550          347 :         if (NumSizingPeriodsPerformed > 0) {
     551          347 :             UpdateSysSizing(state, Constant::CallIndicator::EndSysSizingCalc);
     552          347 :             state.dataSize->SysSizingRunDone = true;
     553              :         } else {
     554            0 :             ShowSevereError(state, format("{}No Sizing periods were performed for System Sizing. No System Sizing calculations saved.", RoutineName));
     555            0 :             ErrorsFound = true;
     556              :         }
     557          547 :     } else if ((state.dataSize->NumZoneSizingInput > 0) &&
     558           94 :                (state.dataGlobal->DoZoneSizing || state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing)) {
     559              :         // If zone sizing but no system sizing - still need to set up system zone equipment and transfer zone sizing data to
     560              :         // TermUnitFinalZoneSizing
     561           80 :         state.dataGlobal->SysSizingCalc = true; // set true here so equipment does not try to size yet
     562           80 :         SimAir = true;
     563           80 :         SimZoneEquip = true;
     564              : 
     565           80 :         ManageZoneEquipment(state, true, SimZoneEquip, SimAir);
     566           80 :         SizingManager::UpdateTermUnitFinalZoneSizing(state); // AirDistUnits have been loaded now so TermUnitSizing values are all in place
     567              :     }
     568          800 :     state.dataGlobal->SysSizingCalc = false;
     569              : 
     570              :     // report sizing results to eio file
     571          800 :     if (state.dataSize->ZoneSizingRunDone) {
     572          427 :         bool isSpace = true;
     573          427 :         if (state.dataHeatBal->doSpaceHeatBalanceSizing) {
     574           18 :             for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
     575           16 :                 if (!state.dataZoneEquip->ZoneEquipConfig(state.dataHeatBal->space(spaceNum).zoneNum).IsControlled) {
     576            2 :                     continue;
     577              :                 }
     578           28 :                 reportZoneSizing(state,
     579           14 :                                  state.dataHeatBal->space(spaceNum),
     580           14 :                                  state.dataSize->FinalSpaceSizing(spaceNum),
     581           14 :                                  state.dataSize->CalcFinalSpaceSizing(spaceNum),
     582           14 :                                  state.dataSize->CalcSpaceSizing,
     583           14 :                                  state.dataSize->SpaceSizing,
     584              :                                  isSpace);
     585              :             }
     586              :         }
     587          427 :         isSpace = false;
     588         4582 :         for (int CtrlZoneNum = 1; CtrlZoneNum <= state.dataGlobal->NumOfZones; ++CtrlZoneNum) {
     589         4155 :             if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum).IsControlled) {
     590          490 :                 continue;
     591              :             }
     592         7330 :             reportZoneSizing(state,
     593         3665 :                              state.dataHeatBal->Zone(CtrlZoneNum),
     594         3665 :                              state.dataSize->FinalZoneSizing(CtrlZoneNum),
     595         3665 :                              state.dataSize->CalcFinalZoneSizing(CtrlZoneNum),
     596         3665 :                              state.dataSize->CalcZoneSizing,
     597         3665 :                              state.dataSize->ZoneSizing,
     598              :                              isSpace);
     599              :         }
     600              :     }
     601              :     // Deallocate arrays no longer needed
     602          800 :     state.dataSize->ZoneSizing.deallocate();
     603              :     // CalcZoneSizing.deallocate();
     604          800 :     if (state.dataHeatBal->doSpaceHeatBalanceSizing) {
     605            2 :         state.dataSize->SpaceSizing.deallocate();
     606              :     }
     607              : 
     608          800 :     if (state.dataSize->SysSizingRunDone) {
     609         1316 :         for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
     610          969 :             auto &calcSysSizing = state.dataSize->CalcSysSizing(AirLoopNum);
     611          969 :             auto &sysSizPeakDDNum = state.dataSize->SysSizPeakDDNum(AirLoopNum);
     612          969 :             auto &finalSysSizing = state.dataSize->FinalSysSizing(AirLoopNum);
     613              : 
     614          969 :             curName = finalSysSizing.AirPriLoopName;
     615          969 :             PreDefTableEntry(state, state.dataOutRptPredefined->pdchSysSizCalcClAir, curName, calcSysSizing.DesCoolVolFlow);
     616          969 :             if (std::abs(calcSysSizing.DesCoolVolFlow) <= 1.e-8) {
     617            0 :                 ShowWarningError(
     618            0 :                     state, format("{}Calculated Cooling Design Air Flow Rate for System={} is zero.", RoutineName, finalSysSizing.AirPriLoopName));
     619            0 :                 ShowContinueError(state, "Check Sizing:Zone and ZoneControl:Thermostat inputs.");
     620              :             }
     621          969 :             PreDefTableEntry(state, state.dataOutRptPredefined->pdchSysSizUserClAir, curName, finalSysSizing.DesCoolVolFlow);
     622          969 :             PreDefTableEntry(state, state.dataOutRptPredefined->pdchSysSizCalcHtAir, curName, calcSysSizing.DesHeatVolFlow);
     623          969 :             if (std::abs(calcSysSizing.DesHeatVolFlow) <= 1.e-8) {
     624            8 :                 ShowWarningError(
     625            8 :                     state, format("{}Calculated Heating Design Air Flow Rate for System={} is zero.", RoutineName, finalSysSizing.AirPriLoopName));
     626           12 :                 ShowContinueError(state, "Check Sizing:Zone and ZoneControl:Thermostat inputs.");
     627              :             }
     628          969 :             std::string_view coolPeakLoadKind;
     629          969 :             std::string coolPeakDDDate;
     630          969 :             int coolPeakDD = 0;
     631          969 :             Real64 coolCap = 0.;
     632          969 :             int timeStepIndexAtPeakCoolLoad = 0;
     633          969 :             if (finalSysSizing.coolingPeakLoad == DataSizing::PeakLoad::SensibleCooling) {
     634          959 :                 coolPeakLoadKind = "Sensible";
     635          959 :                 coolPeakDDDate = sysSizPeakDDNum.cSensCoolPeakDDDate;
     636          959 :                 coolPeakDD = sysSizPeakDDNum.SensCoolPeakDD;
     637          959 :                 coolCap = finalSysSizing.SensCoolCap;
     638          959 :                 if (coolPeakDD > 0) {
     639          959 :                     timeStepIndexAtPeakCoolLoad = sysSizPeakDDNum.TimeStepAtSensCoolPk(coolPeakDD);
     640              :                 }
     641           10 :             } else if (finalSysSizing.coolingPeakLoad == DataSizing::PeakLoad::TotalCooling) {
     642           10 :                 if (finalSysSizing.loadSizingType == DataSizing::LoadSizing::Latent && state.dataHeatBal->DoLatentSizing) {
     643            1 :                     coolPeakLoadKind = "Total Based on Latent";
     644              :                 } else {
     645            9 :                     coolPeakLoadKind = "Total";
     646              :                 }
     647           10 :                 coolPeakDDDate = sysSizPeakDDNum.cTotCoolPeakDDDate;
     648           10 :                 coolPeakDD = sysSizPeakDDNum.TotCoolPeakDD;
     649           10 :                 coolCap = finalSysSizing.TotCoolCap;
     650           10 :                 if (coolPeakDD > 0) {
     651           10 :                     timeStepIndexAtPeakCoolLoad = sysSizPeakDDNum.TimeStepAtTotCoolPk(coolPeakDD);
     652              :                 }
     653              :             }
     654          969 :             if (coolPeakDD > 0) {
     655          969 :                 ReportSysSizing(state,
     656              :                                 curName,
     657              :                                 "Cooling",
     658              :                                 coolPeakLoadKind,
     659              :                                 coolCap,
     660              :                                 calcSysSizing.DesCoolVolFlow,
     661              :                                 finalSysSizing.DesCoolVolFlow,
     662          969 :                                 finalSysSizing.CoolDesDay,
     663              :                                 coolPeakDDDate,
     664              :                                 timeStepIndexAtPeakCoolLoad);
     665              :             } else {
     666            0 :                 ReportSysSizing(state,
     667              :                                 curName,
     668              :                                 "Cooling",
     669              :                                 coolPeakLoadKind,
     670              :                                 coolCap,
     671              :                                 calcSysSizing.DesCoolVolFlow,
     672              :                                 finalSysSizing.DesCoolVolFlow,
     673            0 :                                 finalSysSizing.CoolDesDay,
     674              :                                 coolPeakDDDate,
     675              :                                 0);
     676              :             }
     677          969 :             int heatPeakDD = sysSizPeakDDNum.HeatPeakDD;
     678          969 :             if (heatPeakDD > 0) {
     679          957 :                 ReportSysSizing(state,
     680              :                                 curName,
     681              :                                 "Heating",
     682              :                                 "Sensible",
     683              :                                 finalSysSizing.HeatCap,
     684              :                                 calcSysSizing.DesHeatVolFlow,
     685              :                                 finalSysSizing.DesHeatVolFlow,
     686          957 :                                 finalSysSizing.HeatDesDay,
     687          957 :                                 sysSizPeakDDNum.cHeatPeakDDDate,
     688          957 :                                 sysSizPeakDDNum.TimeStepAtHeatPk(heatPeakDD));
     689              :             } else {
     690           12 :                 ReportSysSizing(state,
     691              :                                 curName,
     692              :                                 "Heating",
     693              :                                 "Sensible",
     694              :                                 finalSysSizing.HeatCap,
     695              :                                 calcSysSizing.DesHeatVolFlow,
     696              :                                 finalSysSizing.DesHeatVolFlow,
     697           12 :                                 finalSysSizing.HeatDesDay,
     698           12 :                                 sysSizPeakDDNum.cHeatPeakDDDate,
     699              :                                 0);
     700              :             }
     701          969 :             PreDefTableEntry(state, state.dataOutRptPredefined->pdchSysSizUserHtAir, curName, finalSysSizing.DesHeatVolFlow);
     702          969 :         }
     703              :         // Deallocate arrays no longer needed
     704          347 :         state.dataSize->SysSizing.deallocate();
     705              :     }
     706              : 
     707              :     // Size SpaceHVAC fractions
     708          800 :     if (state.dataHeatBal->doSpaceHeatBalanceSimulation) {
     709            3 :         for (auto &thisSpaceHVACSplitter : state.dataZoneEquip->zoneEquipSplitter) {
     710            1 :             thisSpaceHVACSplitter.size(state);
     711            2 :         }
     712            3 :         for (auto &thisSpaceHVACMixer : state.dataZoneEquip->zoneEquipMixer) {
     713            1 :             thisSpaceHVACMixer.size(state);
     714            2 :         }
     715              :     }
     716              : 
     717          800 :     if ((state.dataGlobal->DoPlantSizing) && (state.dataSize->NumPltSizInput == 0)) {
     718           36 :         ShowWarningError(
     719              :             state,
     720           36 :             format("{}For a plant sizing run, there must be at least 1 Sizing:Plant object input. SimulationControl Plant Sizing option ignored.",
     721              :                    RoutineName));
     722              :     }
     723              : 
     724          800 :     if ((state.dataSize->NumPltSizInput > 0) && (state.dataGlobal->DoPlantSizing) && !ErrorsFound) {
     725              : 
     726          630 :         ShowMessage(state, "Beginning Plant Sizing Calculations");
     727              :     }
     728              : 
     729          800 :     if (ErrorsFound) {
     730            0 :         ShowFatalError(state, "Program terminates due to preceding conditions.");
     731              :     }
     732          801 : }
     733              : 
     734       827664 : bool CalcdoLoadComponentPulseNow(EnergyPlusData const &state,
     735              :                                  bool const isPulseZoneSizing,
     736              :                                  bool const WarmupFlag,
     737              :                                  int const HourOfDay,
     738              :                                  int const TimeStep,
     739              :                                  Constant::KindOfSim const KindOfSim)
     740              : {
     741              :     // This routine decides whether or not to do a Load Component Pulse.  True when yes it should, false when in shouldn't
     742              :     // This check looks to do the pulse at the first time step of the 10th hour of the day while not in warmup mode.
     743              :     // This needs to be done not just on the first day of a simulation because when the user picks a design day derived from
     744              :     // an attached weather file the design day is not necessarily the first day of the simulation.
     745              : 
     746       827664 :     int constexpr HourDayToPulse(10);
     747       827664 :     int constexpr TimeStepToPulse(1);
     748              : 
     749       827718 :     if ((isPulseZoneSizing) && (!WarmupFlag) && (HourOfDay == HourDayToPulse) && (TimeStep == TimeStepToPulse) &&
     750           54 :         ((KindOfSim == Constant::KindOfSim::RunPeriodDesign) || (state.dataGlobal->DayOfSim == 1))) {
     751           54 :         return true;
     752              :     } else {
     753       827610 :         return false;
     754              :     }
     755              : }
     756              : 
     757          800 : void ManageSystemSizingAdjustments(EnergyPlusData &state)
     758              : {
     759              :     // This routine adjusts system sizing outcomes based on how the zone air terminals finish out their sizing.
     760              :     // The zone models are executed to trigger their sizing routines
     761              :     // Then the air terminal units are scanned to sum design flow rates. Every air terminal connected to a particular air loop is summed for
     762              :     //  1. minimum heating flow rate, 2. maximum heating flow rate, and 3. maximum flow rate.
     763              :     // the summed values are used to "Adjust" the system sizing results
     764              :     // the corrected values are used to autosize the central heating flow ratio, if set to autosize by the user.
     765              : 
     766              :     // Also store zone level flow information for Standard 62.1 calculations, Vpz, Vpz_min, Vdz, and Vdz_min for both cooling and heating
     767              : 
     768          800 :     auto &sd_airterminal = state.dataSingleDuct->sd_airterminal;
     769              : 
     770          800 :     if ((state.dataSize->NumSysSizInput > 0) && (state.dataGlobal->DoSystemSizing)) { // only if there is system sizing
     771              : 
     772              :         // call zone component models to execute their component sizing routines
     773          347 :         bool t_SimZoneEquip(true);
     774          347 :         bool t_SimAir(false);
     775          347 :         state.dataGlobal->BeginEnvrnFlag = true; // trigger begin envrn blocks in zone equipment models
     776          347 :         ZoneEquipmentManager::ManageZoneEquipment(state, true, t_SimZoneEquip, t_SimAir);
     777          347 :         state.dataGlobal->BeginEnvrnFlag = false;
     778              : 
     779         1316 :         for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
     780          969 :             auto &finalSysSizing = state.dataSize->FinalSysSizing(AirLoopNum);
     781              :             // Mine data from ATUs to find new design heating flow rates and new maximum flow rates
     782          969 :             Real64 airLoopMaxFlowRateSum(0.0);
     783          969 :             Real64 airLoopHeatingMinimumFlowRateSum(0.0);
     784          969 :             Real64 airLoopHeatingMaximumFlowRateSum(0.0);
     785              : 
     786              :             // sum up heating and max flows for any single duct systems, store 62.1 values by zone
     787          969 :             if (allocated(sd_airterminal) && state.dataSingleDuct->NumSDAirTerminal > 0) {
     788        19795 :                 for (int singleDuctATUNum = 1; singleDuctATUNum <= state.dataSingleDuct->NumSDAirTerminal; ++singleDuctATUNum) {
     789        18844 :                     auto const &airDistUnit = state.dataDefineEquipment->AirDistUnit(sd_airterminal(singleDuctATUNum).ADUNum);
     790        18844 :                     if (AirLoopNum == sd_airterminal(singleDuctATUNum).AirLoopNum) {
     791         3059 :                         int termUnitSizingIndex = airDistUnit.TermUnitSizingNum;
     792         3059 :                         airLoopMaxFlowRateSum += sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate;
     793              : 
     794         3059 :                         state.dataSize->VpzClgByZone(termUnitSizingIndex) =
     795         3059 :                             sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
     796              : 
     797         6081 :                         if (sd_airterminal(singleDuctATUNum).SysType_Num == SingleDuct::SysType::SingleDuctConstVolReheat ||
     798         3022 :                             sd_airterminal(singleDuctATUNum).SysType_Num == SingleDuct::SysType::SingleDuctConstVolNoReheat) {
     799          633 :                             airLoopHeatingMinimumFlowRateSum += sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate;
     800          633 :                             airLoopHeatingMaximumFlowRateSum += sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate;
     801              : 
     802          633 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     803          633 :                                 sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
     804          633 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) =
     805          633 :                                 sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
     806          633 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
     807          633 :                                 sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
     808              : 
     809              :                         } else {
     810         2426 :                             airLoopHeatingMinimumFlowRateSum +=
     811         2426 :                                 sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * sd_airterminal(singleDuctATUNum).ZoneMinAirFrac;
     812         2426 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) =
     813         2426 :                                 sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate *
     814         2426 :                                 sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; // store std 62.1 values
     815         2426 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
     816         2426 :                                 sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate *
     817         2426 :                                 sd_airterminal(singleDuctATUNum).ZoneMinAirFrac;                // store std 62.1 values
     818         2426 :                             if (sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate > 0.0) { // VS fan ATU has this non zero, so use it
     819            8 :                                 airLoopHeatingMaximumFlowRateSum += sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate;
     820            8 :                                 state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     821            8 :                                     sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate; // store std 62.1 values
     822              :                             } else {
     823         2418 :                                 if (sd_airterminal(singleDuctATUNum).DamperHeatingAction == SingleDuct::Action::Reverse) {
     824           61 :                                     airLoopHeatingMaximumFlowRateSum += sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate;
     825           61 :                                     state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     826           61 :                                         sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
     827         2357 :                                 } else if (sd_airterminal(singleDuctATUNum).DamperHeatingAction == SingleDuct::Action::ReverseWithLimits) {
     828         1092 :                                     airLoopHeatingMaximumFlowRateSum +=
     829         1092 :                                         max(sd_airterminal(singleDuctATUNum).MaxAirVolFlowRateDuringReheat,
     830         1092 :                                             (sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * sd_airterminal(singleDuctATUNum).ZoneMinAirFrac));
     831         1092 :                                     state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     832         1092 :                                         max(sd_airterminal(singleDuctATUNum).MaxAirVolFlowRateDuringReheat,
     833         1092 :                                             (sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate *
     834         1092 :                                              sd_airterminal(singleDuctATUNum).ZoneMinAirFrac)); // store std 62.1 values
     835              :                                 } else {
     836         1265 :                                     airLoopHeatingMaximumFlowRateSum +=
     837         1265 :                                         sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * sd_airterminal(singleDuctATUNum).ZoneMinAirFrac;
     838         1265 :                                     state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     839         1265 :                                         sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate *
     840         1265 :                                         sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; // store std 62.1 values
     841              :                                 }
     842              :                             }
     843              :                         }
     844              :                         // single-path air terminal so Vdz = Vpz
     845         3059 :                         state.dataSize->VdzClgByZone(termUnitSizingIndex) =
     846         3059 :                             state.dataSize->VpzClgByZone(termUnitSizingIndex); // store std 62.1 values
     847         3059 :                         state.dataSize->VdzMinClgByZone(termUnitSizingIndex) =
     848         3059 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex); // store std 62.1 values
     849         3059 :                         state.dataSize->VdzHtgByZone(termUnitSizingIndex) =
     850         3059 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex); // store std 62.1 values
     851         3059 :                         state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) =
     852         3059 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex); // store std 62.1 values
     853              :                     }
     854              :                 }
     855              :             }
     856              : 
     857              :             // sum up heating and max flows for any dual duct air terminals
     858          969 :             if (allocated(state.dataDualDuct->dd_airterminal) && state.dataDualDuct->NumDDAirTerminal > 0) {
     859           34 :                 for (int dualDuctATUNum = 1; dualDuctATUNum <= state.dataDualDuct->NumDDAirTerminal; ++dualDuctATUNum) {
     860           30 :                     if (AirLoopNum == state.dataDualDuct->dd_airterminal(dualDuctATUNum).AirLoopNum) {
     861           19 :                         auto const &airDistUnit = state.dataDefineEquipment->AirDistUnit(state.dataDualDuct->dd_airterminal(dualDuctATUNum).ADUNum);
     862           19 :                         int termUnitSizingIndex = airDistUnit.TermUnitSizingNum;
     863           19 :                         airLoopMaxFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
     864           19 :                         state.dataSize->VpzClgByZone(termUnitSizingIndex) =
     865           19 :                             state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
     866              : 
     867           19 :                         if (state.dataDualDuct->dd_airterminal(dualDuctATUNum).DamperType == DualDuct::DualDuctDamper::ConstantVolume) {
     868            8 :                             airLoopHeatingMaximumFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
     869            8 :                             airLoopHeatingMinimumFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
     870            8 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) =
     871            8 :                                 state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
     872            8 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     873            8 :                                 state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
     874            8 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
     875            8 :                                 state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
     876            8 :                             state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataSize->VpzClgByZone(termUnitSizingIndex);
     877            8 :                             state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = state.dataSize->VpzMinClgByZone(termUnitSizingIndex);
     878            8 :                             state.dataSize->VdzHtgByZone(termUnitSizingIndex) = state.dataSize->VpzHtgByZone(termUnitSizingIndex);
     879            8 :                             state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
     880              : 
     881           11 :                         } else if (state.dataDualDuct->dd_airterminal(dualDuctATUNum).DamperType == DualDuct::DualDuctDamper::VariableVolume) {
     882            0 :                             airLoopHeatingMaximumFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
     883            0 :                             airLoopHeatingMinimumFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate *
     884            0 :                                                                 state.dataDualDuct->dd_airterminal(dualDuctATUNum).ZoneMinAirFrac;
     885            0 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) =
     886            0 :                                 state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate *
     887            0 :                                 state.dataDualDuct->dd_airterminal(dualDuctATUNum).ZoneMinAirFrac; // store std 62.1 value
     888            0 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     889            0 :                                 state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
     890            0 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
     891            0 :                                 state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate *
     892            0 :                                 state.dataDualDuct->dd_airterminal(dualDuctATUNum).ZoneMinAirFrac; // store std 62.1 value
     893            0 :                             state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataSize->VpzClgByZone(termUnitSizingIndex);
     894            0 :                             state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = state.dataSize->VpzMinClgByZone(termUnitSizingIndex);
     895            0 :                             state.dataSize->VdzHtgByZone(termUnitSizingIndex) = state.dataSize->VpzHtgByZone(termUnitSizingIndex);
     896            0 :                             state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
     897           11 :                         } else if (state.dataDualDuct->dd_airterminal(dualDuctATUNum).DamperType == DualDuct::DualDuctDamper::OutdoorAir) {
     898           11 :                             airLoopHeatingMaximumFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
     899              :                             // Calculate the design OA flow rate for this zone
     900           11 :                             bool UseOccSchFlag = false;
     901           11 :                             bool UseMinOASchFlag = false;
     902           11 :                             Real64 designOAductFlow(0.0);
     903              :                             designOAductFlow =
     904           44 :                                 DataSizing::calcDesignSpecificationOutdoorAir(state,
     905           11 :                                                                               state.dataDualDuct->dd_airterminal(dualDuctATUNum).OARequirementsPtr,
     906           11 :                                                                               state.dataDualDuct->dd_airterminal(dualDuctATUNum).CtrlZoneNum,
     907              :                                                                               UseOccSchFlag,
     908              :                                                                               UseMinOASchFlag);
     909           11 :                             airLoopHeatingMinimumFlowRateSum += designOAductFlow;
     910              :                             // is this a dual duct is dual path for Std 62.1 ?? not sure, assume not because Vpz = Vdz
     911              :                             // anyDualPathAirTerminals = true;
     912           11 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = designOAductFlow; // not sure about this
     913           11 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex) = designOAductFlow;    // no heating for this terminal
     914           11 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = designOAductFlow;
     915           11 :                             state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
     916           11 :                             state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = designOAductFlow;
     917           11 :                             state.dataSize->VdzHtgByZone(termUnitSizingIndex) = designOAductFlow;
     918           11 :                             state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = designOAductFlow;
     919              :                         }
     920              :                     }
     921              :                 }
     922              :             }
     923              : 
     924              :             // sum up heating and max flows for any PIU air terminals
     925          969 :             if (allocated(state.dataPowerInductionUnits->PIU) && state.dataPowerInductionUnits->NumPIUs > 0) {
     926          119 :                 for (int pIUATUNum = 1; pIUATUNum <= state.dataPowerInductionUnits->NumPIUs; ++pIUATUNum) {
     927          102 :                     auto const &airDistUnit = state.dataDefineEquipment->AirDistUnit(state.dataPowerInductionUnits->PIU(pIUATUNum).ADUNum);
     928          102 :                     if (AirLoopNum == state.dataPowerInductionUnits->PIU(pIUATUNum).AirLoopNum) {
     929           57 :                         int termUnitSizingIndex = airDistUnit.TermUnitSizingNum;
     930           57 :                         auto &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
     931           57 :                         airLoopMaxFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     932           57 :                         if (state.dataPowerInductionUnits->PIU(pIUATUNum).UnitType_Num ==
     933              :                             DataDefineEquip::ZnAirLoopEquipType::SingleDuct_SeriesPIU_Reheat) {
     934           51 :                             airLoopHeatingMaximumFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     935           51 :                                                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     936           51 :                             airLoopHeatingMinimumFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     937           51 :                                                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     938              : 
     939              :                             // dual path for std 62.1
     940           51 :                             state.dataSize->VpzClgByZone(termUnitSizingIndex) = state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     941          102 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     942           51 :                                                                                    state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     943           51 :                             state.dataSize->VdzClgByZone(termUnitSizingIndex) =
     944           51 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxTotAirVolFlow; // which is constant for series PIU
     945           51 :                             state.dataSize->VdzMinClgByZone(termUnitSizingIndex) =
     946           51 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum)
     947           51 :                                     .MaxTotAirVolFlow; // min dz is the same as max because series PIU has constant discharge volume
     948              : 
     949           51 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     950           51 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     951           51 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow; // runs at minimum primary for heating always
     952           51 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
     953           51 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     954           51 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow; // runs at minimum primary for heating always
     955           51 :                             state.dataSize->VdzHtgByZone(termUnitSizingIndex) =
     956           51 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxTotAirVolFlow; // which is constant for series PIU
     957           51 :                             state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) =
     958           51 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxTotAirVolFlow; // which is constant for series PIU
     959              : 
     960              :                             // store Ep for 62.1 calculations
     961           51 :                             thisTermUnitFinalZoneSizing.ZonePrimaryAirFraction =
     962           51 :                                 state.dataSize->VpzMinClgByZone(termUnitSizingIndex) /
     963           51 :                                 state.dataSize->VdzClgByZone(termUnitSizingIndex); // min primary divided by max total
     964           51 :                             thisTermUnitFinalZoneSizing.ZonePrimaryAirFractionHtg =
     965           51 :                                 state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) / state.dataSize->VdzHtgByZone(termUnitSizingIndex);
     966              : 
     967            6 :                         } else if (state.dataPowerInductionUnits->PIU(pIUATUNum).UnitType_Num ==
     968              :                                    DataDefineEquip::ZnAirLoopEquipType::SingleDuct_ParallelPIU_Reheat) {
     969            6 :                             airLoopHeatingMaximumFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     970            6 :                                                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     971            6 :                             airLoopHeatingMinimumFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     972            6 :                                                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     973              : 
     974              :                             // dual path for std 62.1
     975            6 :                             state.dataSize->VpzClgByZone(termUnitSizingIndex) = state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     976           12 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     977            6 :                                                                                    state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     978            6 :                             state.dataSize->VdzClgByZone(termUnitSizingIndex) =
     979            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum)
     980            6 :                                     .MaxPriAirVolFlow; // for Parallel PIU expect Fan off during max cooling, so discharge is all primary
     981            6 :                             state.dataSize->VdzMinClgByZone(termUnitSizingIndex) =
     982            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     983            6 :                                     state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow +
     984            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum)
     985            6 :                                     .MaxSecAirVolFlow; // expect secondary fan to be running at min cooling, for reheat
     986              : 
     987            6 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     988            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     989            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow; // primary at minimum
     990            6 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
     991            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     992            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow; // primary at minimum
     993            6 :                             state.dataSize->VdzHtgByZone(termUnitSizingIndex) =
     994            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     995            6 :                                     state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow +
     996            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxSecAirVolFlow; // expect min primary and CV fan running
     997            6 :                             state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) =
     998            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     999            6 :                                     state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow +
    1000            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxSecAirVolFlow; // expect min primary and CV fan running
    1001              : 
    1002            6 :                             thisTermUnitFinalZoneSizing.ZonePrimaryAirFraction =
    1003            6 :                                 state.dataSize->VpzMinClgByZone(termUnitSizingIndex) /
    1004            6 :                                 state.dataSize->VdzClgByZone(termUnitSizingIndex); // min primary divided by max total
    1005            6 :                             thisTermUnitFinalZoneSizing.ZonePrimaryAirFractionHtg =
    1006            6 :                                 state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) / state.dataSize->VdzHtgByZone(termUnitSizingIndex);
    1007              :                         }
    1008              :                     }
    1009              :                 }
    1010              :             }
    1011              : 
    1012          969 :             auto &IndUnit = state.dataHVACSingleDuctInduc->IndUnit;
    1013          969 :             int NumIndUnits = state.dataHVACSingleDuctInduc->NumIndUnits;
    1014              : 
    1015              :             // sum up heating and max flows for any four pipe induction units
    1016              :             // dual path for std 62.1
    1017          969 :             if (allocated(IndUnit) && (NumIndUnits > 0)) {
    1018            5 :                 for (int indUnitNum = 1; indUnitNum <= NumIndUnits; ++indUnitNum) {
    1019            4 :                     auto const &airDistUnit = state.dataDefineEquipment->AirDistUnit(IndUnit(indUnitNum).ADUNum);
    1020            4 :                     if (AirLoopNum == IndUnit(indUnitNum).AirLoopNum) {
    1021            4 :                         int termUnitSizingIndex = airDistUnit.TermUnitSizingNum;
    1022            4 :                         airLoopHeatingMaximumFlowRateSum += IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1023            4 :                         airLoopHeatingMinimumFlowRateSum += IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1024            4 :                         airLoopMaxFlowRateSum += IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1025              :                         // store Std 62.1 values, CV system
    1026            4 :                         state.dataSize->VpzClgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1027            4 :                         state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1028            4 :                         state.dataSize->VdzClgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxTotAirVolFlow;
    1029            4 :                         state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxTotAirVolFlow;
    1030            4 :                         state.dataSize->VpzHtgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1031            4 :                         state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1032            4 :                         state.dataSize->VdzHtgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxTotAirVolFlow;
    1033            4 :                         state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxTotAirVolFlow;
    1034              :                     }
    1035              :                 }
    1036              :             }
    1037              : 
    1038              :             // sum up heating and max flows for any two pipe constant volume cooled beam terminal units
    1039          969 :             if (allocated(state.dataHVACCooledBeam->CoolBeam) && (state.dataHVACCooledBeam->NumCB > 0)) {
    1040            6 :                 for (int coolBeamNum = 1; coolBeamNum <= state.dataHVACCooledBeam->NumCB; ++coolBeamNum) {
    1041            5 :                     auto const &airDistUnit = state.dataDefineEquipment->AirDistUnit(state.dataHVACCooledBeam->CoolBeam(coolBeamNum).ADUNum);
    1042            5 :                     if (AirLoopNum == state.dataHVACCooledBeam->CoolBeam(coolBeamNum).AirLoopNum) {
    1043            5 :                         int termUnitSizingIndex = airDistUnit.TermUnitSizingNum;
    1044            5 :                         airLoopHeatingMaximumFlowRateSum += state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1045            5 :                         airLoopHeatingMinimumFlowRateSum += state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1046            5 :                         airLoopMaxFlowRateSum += state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1047              : 
    1048              :                         // store std 62.1 values, beam will actually have secondary flow but that is not part of the model since it uses non air
    1049              :                         // system term, we have no secondary flow rate information to work with
    1050            5 :                         state.dataSize->VpzClgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1051            5 :                         state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1052            5 :                         state.dataSize->VpzHtgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1053            5 :                         state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1054            5 :                         state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1055            5 :                         state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1056            5 :                         state.dataSize->VdzHtgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1057            5 :                         state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1058              :                     }
    1059              :                 }
    1060              :             }
    1061              : 
    1062              :             // sum up heating and max flows for any four pipe cooled beam terminal units (the only one using the airTerminalPtr at this point)
    1063          969 :             if (allocated(state.dataDefineEquipment->AirDistUnit) && (int)state.dataDefineEquipment->AirDistUnit.size() > 0) {
    1064        20143 :                 for (int aDUNum = 1; aDUNum <= (int)state.dataDefineEquipment->AirDistUnit.size(); ++aDUNum) {
    1065        19174 :                     auto &airDistUnit = state.dataDefineEquipment->AirDistUnit(aDUNum);
    1066        19174 :                     if (airDistUnit.airTerminalPtr.get() != nullptr) {
    1067          120 :                         if (AirLoopNum == airDistUnit.airTerminalPtr->getAirLoopNum()) {
    1068           30 :                             airLoopHeatingMaximumFlowRateSum += airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1069           30 :                             airLoopHeatingMinimumFlowRateSum += airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1070           30 :                             airLoopMaxFlowRateSum += airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1071              :                             // store Std 62.1 values, have no modeling of secondary flow rates for induced flow from beam
    1072           30 :                             int termUnitSizingIndex = airDistUnit.airTerminalPtr->getTermUnitSizingIndex();
    1073           30 :                             state.dataSize->VpzClgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1074           30 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1075           30 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1076           30 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1077           30 :                             state.dataSize->VdzClgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1078           30 :                             state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1079           30 :                             state.dataSize->VdzHtgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1080           30 :                             state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1081              :                         }
    1082              :                     }
    1083              :                 }
    1084              :             }
    1085              : 
    1086              :             // sum up flows for any air terminal mixers
    1087          969 :             if (allocated(state.dataSingleDuct->SysATMixer) && (state.dataSingleDuct->NumATMixers > 0)) {
    1088           71 :                 for (int aTMixerNum = 1; aTMixerNum <= state.dataSingleDuct->NumATMixers; ++aTMixerNum) {
    1089           59 :                     auto const &airDistUnit = state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->SysATMixer(aTMixerNum).ADUNum);
    1090           59 :                     if (AirLoopNum == state.dataSingleDuct->SysATMixer(aTMixerNum).AirLoopNum) {
    1091           59 :                         int termUnitSizingIndex = airDistUnit.TermUnitSizingNum;
    1092           59 :                         airLoopHeatingMaximumFlowRateSum += state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1093           59 :                         airLoopHeatingMinimumFlowRateSum += state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1094           59 :                         airLoopMaxFlowRateSum += state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1095              : 
    1096           59 :                         state.dataSize->VpzClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1097           59 :                         state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1098           59 :                         state.dataSize->VpzHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1099           59 :                         state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1100              :                         // the ZoneHVAC devices will have secondary flow but how to get it, future work
    1101           59 :                         state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1102           59 :                         state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1103           59 :                         state.dataSize->VdzHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1104           59 :                         state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1105              :                     }
    1106              :                 }
    1107              :             }
    1108              : 
    1109          969 :             std::string curName = finalSysSizing.AirPriLoopName;
    1110          969 :             BaseSizer::reportSizerOutput(
    1111              :                 state, "AirLoopHVAC", curName, "Sum of Air Terminal Maximum Heating Flow Rates [m3/s]", airLoopHeatingMaximumFlowRateSum);
    1112          969 :             BaseSizer::reportSizerOutput(
    1113              :                 state, "AirLoopHVAC", curName, "Sum of Air Terminal Minimum Heating Flow Rates [m3/s]", airLoopHeatingMinimumFlowRateSum);
    1114          969 :             BaseSizer::reportSizerOutput(state, "AirLoopHVAC", curName, "Sum of Air Terminal Maximum Flow Rates [m3/s]", airLoopMaxFlowRateSum);
    1115              : 
    1116              :             // Adjust system sizing info
    1117          969 :             if (allocated(state.dataSize->FinalSysSizing)) {
    1118              :                 // correct sizing design heating volume flow rate based on finalized air terminal unit operation
    1119              : 
    1120          969 :                 if (finalSysSizing.SizingOption ==
    1121              :                     DataSizing::SizingConcurrence::NonCoincident) { // If non-coincident sizing method for this air loop, the we can use these sum's
    1122              :                                                                     // from
    1123              :                                                                     // air terminals directly
    1124          874 :                     finalSysSizing.DesHeatVolFlow = max(airLoopHeatingMaximumFlowRateSum, finalSysSizing.DesHeatVolFlow);
    1125          874 :                     finalSysSizing.DesMainVolFlow = max(airLoopMaxFlowRateSum, finalSysSizing.DesMainVolFlow);
    1126          874 :                     if (finalSysSizing.sysSizeCoolingDominant) {
    1127          766 :                         finalSysSizing.DesCoolVolFlow = finalSysSizing.DesMainVolFlow;
    1128          766 :                         finalSysSizing.MassFlowAtCoolPeak = finalSysSizing.DesCoolVolFlow * state.dataEnvrn->StdRhoAir;
    1129          108 :                     } else if (finalSysSizing.sysSizeHeatingDominant) { // make sure cooling is at least at minimum.
    1130           88 :                         finalSysSizing.DesCoolVolFlow = max(airLoopHeatingMinimumFlowRateSum, finalSysSizing.DesCoolVolFlow);
    1131           88 :                         finalSysSizing.MassFlowAtCoolPeak = finalSysSizing.DesCoolVolFlow * state.dataEnvrn->StdRhoAir;
    1132              :                     }
    1133           95 :                 } else if (finalSysSizing.SizingOption == DataSizing::SizingConcurrence::Coincident) {
    1134              : 
    1135           95 :                     if (finalSysSizing.sysSizeCoolingDominant) { // use minimum heating flow sum from air terminals
    1136              :                         // know that minimum heating flow is a hard minimum regardless of concurrence situation, so make sure that design is at
    1137              :                         // least that high.
    1138           95 :                         finalSysSizing.DesHeatVolFlow = max(airLoopHeatingMinimumFlowRateSum, finalSysSizing.DesHeatVolFlow);
    1139           95 :                         finalSysSizing.DesMainVolFlow = max(airLoopHeatingMinimumFlowRateSum, finalSysSizing.DesMainVolFlow);
    1140           95 :                         finalSysSizing.DesCoolVolFlow = finalSysSizing.DesMainVolFlow;
    1141           95 :                         finalSysSizing.MassFlowAtCoolPeak = finalSysSizing.DesCoolVolFlow * state.dataEnvrn->StdRhoAir;
    1142            0 :                     } else if (finalSysSizing.sysSizeHeatingDominant) { // use maximum heating flow sum from air terminals
    1143            0 :                         finalSysSizing.DesHeatVolFlow = max(airLoopHeatingMaximumFlowRateSum, finalSysSizing.DesHeatVolFlow);
    1144            0 :                         finalSysSizing.DesMainVolFlow = max(airLoopHeatingMaximumFlowRateSum, finalSysSizing.DesMainVolFlow);
    1145              :                         // make sure cooling is at least at minimum.
    1146            0 :                         finalSysSizing.DesCoolVolFlow = max(airLoopHeatingMinimumFlowRateSum, finalSysSizing.DesCoolVolFlow);
    1147            0 :                         finalSysSizing.MassFlowAtCoolPeak = finalSysSizing.DesCoolVolFlow * state.dataEnvrn->StdRhoAir;
    1148              :                     }
    1149              :                 }
    1150              :                 // report out adjusted design flow rates
    1151          969 :                 BaseSizer::reportSizerOutput(
    1152              :                     state, "AirLoopHVAC", curName, "Adjusted Heating Design Air Flow Rate [m3/s]", finalSysSizing.DesHeatVolFlow);
    1153         1938 :                 OutputReportPredefined::PreDefTableEntry(
    1154         1938 :                     state, state.dataOutRptPredefined->pdchSysSizAdjustedHtAir, curName, finalSysSizing.DesHeatVolFlow, 4);
    1155          969 :                 BaseSizer::reportSizerOutput(
    1156              :                     state, "AirLoopHVAC", curName, "Adjusted Cooling Design Air Flow Rate [m3/s]", finalSysSizing.DesCoolVolFlow);
    1157         1938 :                 OutputReportPredefined::PreDefTableEntry(
    1158         1938 :                     state, state.dataOutRptPredefined->pdchSysSizAdjustedClAir, curName, finalSysSizing.DesCoolVolFlow, 4);
    1159          969 :                 BaseSizer::reportSizerOutput(
    1160              :                     state, "AirLoopHVAC", curName, "Adjusted Main Design Air Flow Rate [m3/s]", finalSysSizing.DesMainVolFlow);
    1161         1938 :                 OutputReportPredefined::PreDefTableEntry(
    1162         1938 :                     state, state.dataOutRptPredefined->pdchSysSizAdjustedMainAir, curName, finalSysSizing.DesMainVolFlow, 4);
    1163              : 
    1164              :                 // Autosize central heating min system air flow rate, using corrected design heating flow, using maximum heating flow summation
    1165          969 :                 if (finalSysSizing.SysAirMinFlowRatWasAutoSized) {
    1166            3 :                     if (finalSysSizing.DesMainVolFlow > 0.0) { // protect div by zero
    1167            3 :                         finalSysSizing.SysAirMinFlowRat = finalSysSizing.DesHeatVolFlow / finalSysSizing.DesMainVolFlow;
    1168              :                     } else { // big trouble anyway.
    1169            0 :                         finalSysSizing.SysAirMinFlowRat = 1.0;
    1170              :                     }
    1171            3 :                     BaseSizer::reportSizerOutput(
    1172              :                         state, "AirLoopHVAC", curName, "Calculated Heating Air Flow Ratio []", finalSysSizing.SysAirMinFlowRat);
    1173            6 :                     OutputReportPredefined::PreDefTableEntry(
    1174            6 :                         state, state.dataOutRptPredefined->pdchSysSizCalcHeatFlowRatio, curName, finalSysSizing.SysAirMinFlowRat, 4);
    1175            3 :                     BaseSizer::reportSizerOutput(state, "AirLoopHVAC", curName, "User Heating Air Flow Ratio []", finalSysSizing.SysAirMinFlowRat);
    1176            6 :                     OutputReportPredefined::PreDefTableEntry(
    1177            9 :                         state, state.dataOutRptPredefined->pdchSysSizUserHeatFlowRatio, curName, finalSysSizing.SysAirMinFlowRat, 4);
    1178              :                 } else {
    1179          966 :                     BaseSizer::reportSizerOutput(state, "AirLoopHVAC", curName, "User Heating Air Flow Ratio []", finalSysSizing.SysAirMinFlowRat);
    1180         1932 :                     OutputReportPredefined::PreDefTableEntry(
    1181         1932 :                         state, state.dataOutRptPredefined->pdchSysSizUserHeatFlowRatio, curName, finalSysSizing.SysAirMinFlowRat, 4);
    1182          966 :                     Real64 calcSysAirMinFlowRat(0.0);
    1183          966 :                     if (finalSysSizing.DesMainVolFlow > 0.0) { // protect div by zero
    1184          966 :                         calcSysAirMinFlowRat = finalSysSizing.DesHeatVolFlow / finalSysSizing.DesMainVolFlow;
    1185              :                     }
    1186          966 :                     BaseSizer::reportSizerOutput(state, "AirLoopHVAC", curName, "Calculated Heating Air Flow Ratio []", calcSysAirMinFlowRat);
    1187         1932 :                     OutputReportPredefined::PreDefTableEntry(
    1188         2898 :                         state, state.dataOutRptPredefined->pdchSysSizCalcHeatFlowRatio, curName, calcSysAirMinFlowRat, 4);
    1189              :                 }
    1190              :             }
    1191          969 :         }
    1192              : 
    1193              :     } // if doing any system sizing
    1194          800 : }
    1195              : 
    1196          800 : void ManageSystemVentilationAdjustments(EnergyPlusData &state)
    1197              : {
    1198          800 :     auto &AirDistUnit = state.dataDefineEquipment->AirDistUnit;
    1199          800 :     auto &FinalSysSizing = state.dataSize->FinalSysSizing;
    1200          800 :     auto &VbzByZone = state.dataSize->VbzByZone;
    1201          800 :     auto &AirToZoneNodeInfo = state.dataAirLoop->AirToZoneNodeInfo;
    1202              : 
    1203              :     // redo std 62.1 calculations using latest information on zone flows and report to tables
    1204              : 
    1205              :     // redo 62.1 zone calculations with final (or user) zone terminal flow sizes, only redo calculations that might change with final flows
    1206         1769 :     for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
    1207              :         int SysSizNum =
    1208          969 :             Util::FindItemInList(FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
    1209          969 :         if (SysSizNum == 0) {
    1210            4 :             SysSizNum = 1; // use first when none applicable
    1211              :         }
    1212          969 :         if (FinalSysSizing(AirLoopNum).OAAutoSized &&
    1213          930 :             (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::VRP ||
    1214          923 :              state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::SP) &&
    1215         1908 :             state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones > 1 &&
    1216            9 :             FinalSysSizing(AirLoopNum).loadSizingType != DataSizing::LoadSizing::Ventilation) {
    1217              : 
    1218              :             // Loop over all zones connected to air loop, redo both cooling and heating calcs for Zdz minimum discharge outdoor air fraction for
    1219              :             // each zone
    1220           49 :             for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++zoneNum) {
    1221           40 :                 int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
    1222           40 :                 auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
    1223           40 :                 if (state.dataSize->VdzMinClgByZone(termUnitSizingIndex) > 0.0) {
    1224           40 :                     state.dataSize->ZdzClgByZone(termUnitSizingIndex) =
    1225           40 :                         min(1.0, thisTermUnitFinalZoneSizing.VozClgByZone / state.dataSize->VdzMinClgByZone(termUnitSizingIndex));
    1226              :                 } else { // would divide by zero, so set to max ??
    1227            0 :                     state.dataSize->ZdzClgByZone(termUnitSizingIndex) = 1.0;
    1228              :                 }
    1229           40 :                 if (state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) > 0.0) {
    1230           40 :                     state.dataSize->ZdzHtgByZone(termUnitSizingIndex) =
    1231           40 :                         min(1.0, thisTermUnitFinalZoneSizing.VozHtgByZone / state.dataSize->VdzMinHtgByZone(termUnitSizingIndex));
    1232              :                 } else { // would divide by zero, so set to max
    1233            0 :                     state.dataSize->ZdzHtgByZone(termUnitSizingIndex) = 1.0;
    1234              :                 }
    1235              :             }
    1236            9 :             for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesHeated; ++zoneNum) {
    1237            0 :                 int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
    1238            0 :                 auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
    1239            0 :                 if (state.dataSize->VdzMinClgByZone(termUnitSizingIndex) > 0.0) {
    1240            0 :                     state.dataSize->ZdzClgByZone(termUnitSizingIndex) =
    1241            0 :                         min(1.0, thisTermUnitFinalZoneSizing.VozClgByZone / state.dataSize->VdzMinClgByZone(termUnitSizingIndex));
    1242              :                 } else { // would divide by zero, so set to max ??
    1243            0 :                     state.dataSize->ZdzClgByZone(termUnitSizingIndex) = 1.0;
    1244              :                 }
    1245            0 :                 if (state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) > 0.0) {
    1246            0 :                     state.dataSize->ZdzHtgByZone(termUnitSizingIndex) =
    1247            0 :                         min(1.0, thisTermUnitFinalZoneSizing.VozHtgByZone / state.dataSize->VdzMinHtgByZone(termUnitSizingIndex));
    1248              :                 } else { // would divide by zero, so set to max
    1249            0 :                     state.dataSize->ZdzHtgByZone(termUnitSizingIndex) = 1.0;
    1250              :                 }
    1251              :             } // end loop over zones on air loop to calculate Zdz values
    1252              : 
    1253              :             // Sum Voz values for System Vou, in E+ the Vbz value has now been corrected to remove population Diversity, so we add the term back
    1254              :             // in here directly to get Vou, now corrected again to only apply D to the people part
    1255            9 :             state.dataSize->VouBySys(AirLoopNum) =
    1256            9 :                 state.dataSize->DBySys(AirLoopNum) * state.dataSize->SumRpxPzBySys(AirLoopNum) + state.dataSize->SumRaxAzBySys(AirLoopNum);
    1257              :             // redo VpzClgSumBySys( AirLoopNum ) with latest values, for reporting
    1258            9 :             state.dataSize->VpzClgSumBySys(AirLoopNum) = 0.0;
    1259           49 :             for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++zoneNum) {
    1260           40 :                 int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
    1261           40 :                 state.dataSize->VpzClgSumBySys(AirLoopNum) += state.dataSize->VdzClgByZone(termUnitSizingIndex);
    1262              :             }
    1263            9 :             for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesHeated; ++zoneNum) {
    1264            0 :                 int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
    1265            0 :                 int MatchingCooledZoneNum = General::FindNumberInList(
    1266            0 :                     termUnitSizingIndex, AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex, AirToZoneNodeInfo(AirLoopNum).NumZonesCooled);
    1267            0 :                 if (MatchingCooledZoneNum == 0) {
    1268            0 :                     state.dataSize->VpzClgSumBySys(AirLoopNum) += state.dataSize->VdzClgByZone(termUnitSizingIndex);
    1269              :                 }
    1270              :             }
    1271              : 
    1272              :             // Fill Vps for cooling VRP calculation, use cooling design flow rate as adjusted in ManageSystemSizingAdjustments ( to use
    1273              :             // coincident sizing result if available for block air flow
    1274            9 :             state.dataSize->VpsClgBySys(AirLoopNum) = FinalSysSizing(AirLoopNum).DesCoolVolFlow;
    1275              : 
    1276              :             // Fill Vps for heating VRP calculation, use heating min by zone from air terminal scan in ManageSystemSizingAdjustments
    1277            9 :             state.dataSize->VpsHtgBySys(AirLoopNum) = 0.0;
    1278            9 :             state.dataSize->VpzHtgSumBySys(AirLoopNum) = 0.0; // for reporting only
    1279           49 :             for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++zoneNum) {
    1280           40 :                 int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
    1281           40 :                 state.dataSize->VpsHtgBySys(AirLoopNum) += state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
    1282           40 :                 state.dataSize->VpzHtgSumBySys(AirLoopNum) += state.dataSize->VpzHtgByZone(termUnitSizingIndex);
    1283              :             }
    1284            9 :             for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesHeated; ++zoneNum) {
    1285            0 :                 int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
    1286            0 :                 int MatchingCooledZoneNum = General::FindNumberInList(
    1287            0 :                     termUnitSizingIndex, AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex, AirToZoneNodeInfo(AirLoopNum).NumZonesCooled);
    1288            0 :                 if (MatchingCooledZoneNum == 0) {
    1289            0 :                     state.dataSize->VpsHtgBySys(AirLoopNum) += state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
    1290            0 :                     state.dataSize->VpzHtgSumBySys(AirLoopNum) += state.dataSize->VpzHtgByZone(termUnitSizingIndex);
    1291              :                 }
    1292              :             }
    1293              :             // Fill Xs values
    1294            9 :             state.dataSize->XsBySysCool(AirLoopNum) = state.dataSize->VouBySys(AirLoopNum) / state.dataSize->VpsClgBySys(AirLoopNum);
    1295            9 :             state.dataSize->XsBySysHeat(AirLoopNum) = state.dataSize->VouBySys(AirLoopNum) / state.dataSize->VpsHtgBySys(AirLoopNum);
    1296              : 
    1297              :             // Loop over zones and calculate Evz for each for both cooling and heating, and find mins
    1298            9 :             state.dataSize->EvzMinBySysCool(AirLoopNum) = 1.0;
    1299            9 :             state.dataSize->EvzMinBySysHeat(AirLoopNum) = 1.0;
    1300              : 
    1301              :             // make two passes, one for cooled zone and one for heated zones, if some zones are duplicate, it's OK, it'll just redo the same calcs
    1302           27 :             for (int coolHeatPass = 1; coolHeatPass <= 2; ++coolHeatPass) {
    1303           18 :                 int numZones = 0;
    1304           18 :                 if (coolHeatPass == 1) {
    1305            9 :                     numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesCooled;
    1306              :                 } else {
    1307            9 :                     numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesHeated;
    1308              :                 }
    1309           58 :                 for (int zoneNum = 1; zoneNum <= numZones; ++zoneNum) {
    1310           40 :                     int termUnitSizingIndex = 0;
    1311           40 :                     if (coolHeatPass == 1) {
    1312           40 :                         termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
    1313              :                     } else {
    1314            0 :                         termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
    1315              :                     }
    1316           40 :                     auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
    1317           40 :                     Real64 Er = thisTermUnitFinalZoneSizing.ZoneSecondaryRecirculation; // user input in Zone Air Distribution design spec object
    1318              : 
    1319           40 :                     if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::SP) { // 62.1 simplified procedure
    1320            5 :                         if (state.dataSize->DBySys(AirLoopNum) < 0.60) {
    1321            2 :                             state.dataSize->EvzByZoneHeat(termUnitSizingIndex) = 0.88 * state.dataSize->DBySys(AirLoopNum) + 0.22;
    1322              :                         } else {
    1323            3 :                             state.dataSize->EvzByZoneHeat(termUnitSizingIndex) = 0.75;
    1324              :                         }
    1325            5 :                         state.dataSize->EvzByZoneCool(termUnitSizingIndex) = state.dataSize->EvzByZoneHeat(termUnitSizingIndex);
    1326           35 :                     } else if (Er > 0.0) { // 62.1 ventilation rate procedure - multi path zone
    1327              :                         // Find Evz for cooling
    1328            1 :                         Real64 Ep_Clg = thisTermUnitFinalZoneSizing.ZonePrimaryAirFraction; // as adjusted in ManageSystemSizingAdjustments();
    1329            1 :                         Real64 Fa_Clg = Ep_Clg + (1.0 - Ep_Clg) * Er;
    1330            1 :                         state.dataSize->FaByZoneCool(termUnitSizingIndex) = Fa_Clg;
    1331            1 :                         Real64 Fb_Clg = Ep_Clg;
    1332            1 :                         state.dataSize->FbByZoneCool(termUnitSizingIndex) = Fb_Clg;
    1333            1 :                         Real64 Ez_Clg = thisTermUnitFinalZoneSizing.ZoneADEffCooling; // user input in Zone Air Distribution design spec object
    1334            1 :                         Real64 Fc_Clg = 1.0 - (1.0 - Ez_Clg) * (1.0 - Er) * (1 - Ep_Clg);
    1335            1 :                         state.dataSize->FcByZoneCool(termUnitSizingIndex) = Fc_Clg;
    1336            2 :                         state.dataSize->EvzByZoneCool(termUnitSizingIndex) = (Fa_Clg + state.dataSize->XsBySysCool(AirLoopNum) * Fb_Clg -
    1337            1 :                                                                               state.dataSize->ZdzClgByZone(termUnitSizingIndex) * Ep_Clg * Fc_Clg) /
    1338              :                                                                              Fa_Clg;
    1339              :                         // note that SimAirServingZones::LimitZoneVentEff is intended only for single path per I/O ref
    1340              : 
    1341              :                         // find Evz for heating
    1342            1 :                         Real64 Ep_Htg = thisTermUnitFinalZoneSizing.ZonePrimaryAirFractionHtg; // as adjusted in ManageSystemSizingAdjustments();
    1343            1 :                         Real64 Fa_Htg = Ep_Htg + (1.0 - Ep_Htg) * Er;
    1344            1 :                         state.dataSize->FaByZoneHeat(termUnitSizingIndex) = Fa_Htg;
    1345            1 :                         Real64 Fb_Htg = Ep_Htg;
    1346            1 :                         state.dataSize->FbByZoneHeat(termUnitSizingIndex) = Fb_Htg;
    1347            1 :                         Real64 Ez_Htg = thisTermUnitFinalZoneSizing.ZoneADEffHeating; // user input in Zone Air Distribution design spec object
    1348            1 :                         Real64 Fc_Htg = 1.0 - (1.0 - Ez_Htg) * (1.0 - Er) * (1 - Ep_Htg);
    1349            1 :                         state.dataSize->FcByZoneHeat(termUnitSizingIndex) = Fc_Htg;
    1350            2 :                         state.dataSize->EvzByZoneHeat(termUnitSizingIndex) = (Fa_Htg + state.dataSize->XsBySysHeat(AirLoopNum) * Fb_Htg -
    1351            1 :                                                                               state.dataSize->ZdzHtgByZone(termUnitSizingIndex) * Ep_Htg * Fc_Htg) /
    1352              :                                                                              Fa_Htg;
    1353              : 
    1354              :                     } else { // 62.1 ventilation rate procedure - single path zone
    1355           34 :                         state.dataSize->EvzByZoneCool(termUnitSizingIndex) =
    1356           34 :                             1.0 + state.dataSize->XsBySysCool(AirLoopNum) - state.dataSize->ZdzClgByZone(termUnitSizingIndex);
    1357           68 :                         SimAirServingZones::LimitZoneVentEff(state,
    1358           34 :                                                              state.dataSize->XsBySysCool(AirLoopNum),
    1359           34 :                                                              VbzByZone(termUnitSizingIndex) / state.dataSize->EvzByZoneCool(termUnitSizingIndex),
    1360              :                                                              termUnitSizingIndex,
    1361           34 :                                                              state.dataSize->EvzByZoneCool(termUnitSizingIndex));
    1362           34 :                         state.dataSize->EvzByZoneHeat(termUnitSizingIndex) =
    1363           34 :                             1.0 + state.dataSize->XsBySysHeat(AirLoopNum) - state.dataSize->ZdzHtgByZone(termUnitSizingIndex);
    1364           68 :                         SimAirServingZones::LimitZoneVentEff(state,
    1365           34 :                                                              state.dataSize->XsBySysHeat(AirLoopNum),
    1366           34 :                                                              VbzByZone(termUnitSizingIndex) / state.dataSize->EvzByZoneHeat(termUnitSizingIndex),
    1367              :                                                              termUnitSizingIndex,
    1368           34 :                                                              state.dataSize->EvzByZoneHeat(termUnitSizingIndex));
    1369              :                     }
    1370              : 
    1371           40 :                     if (state.dataSize->EvzByZoneCool(termUnitSizingIndex) < state.dataSize->EvzMinBySysCool(AirLoopNum)) {
    1372           16 :                         state.dataSize->EvzMinBySysCool(AirLoopNum) = state.dataSize->EvzByZoneCool(termUnitSizingIndex);
    1373              :                     }
    1374           40 :                     if (state.dataSize->EvzByZoneHeat(termUnitSizingIndex) < state.dataSize->EvzMinBySysHeat(AirLoopNum)) {
    1375           13 :                         state.dataSize->EvzMinBySysHeat(AirLoopNum) = state.dataSize->EvzByZoneHeat(termUnitSizingIndex);
    1376              :                     }
    1377              :                 } // end loop over zones on air loop to calculate Evz by zone and find mins
    1378              : 
    1379              :                 // calculate Vot for both cooling and heating
    1380           18 :                 state.dataSize->VotClgBySys(AirLoopNum) = state.dataSize->VouBySys(AirLoopNum) / state.dataSize->EvzMinBySysCool(AirLoopNum);
    1381           18 :                 state.dataSize->VotHtgBySys(AirLoopNum) = state.dataSize->VouBySys(AirLoopNum) / state.dataSize->EvzMinBySysHeat(AirLoopNum);
    1382              :                 // the design zone ventilation value is based on the larger of the system-level cooling Vot and/or heating Vot
    1383           18 :                 FinalSysSizing(AirLoopNum).DesOutAirVolFlow = max(state.dataSize->VotClgBySys(AirLoopNum), state.dataSize->VotHtgBySys(AirLoopNum));
    1384              :             }
    1385              :         } // system OA is autosized and VRP
    1386          960 :         else if ((FinalSysSizing(AirLoopNum).OAAutoSized && state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::VRP &&
    1387            0 :                   state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones == 1)) { // single zone VRP
    1388            0 :             int termUnitSizingIndex = 0;
    1389            0 :             termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(1);
    1390            0 :             if (termUnitSizingIndex == 0) {
    1391            0 :                 termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(1);
    1392              :             }
    1393            0 :             auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
    1394              :             // single zone cooling
    1395            0 :             state.dataSize->VotClgBySys(AirLoopNum) = VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffCooling;
    1396            0 :             state.dataSize->EvzByZoneCool(termUnitSizingIndex) = thisTermUnitFinalZoneSizing.ZoneADEffCooling;
    1397            0 :             state.dataSize->EvzMinBySysCool(AirLoopNum) = state.dataSize->EvzByZoneCool(termUnitSizingIndex);
    1398            0 :             state.dataSize->VpsClgBySys(AirLoopNum) = FinalSysSizing(AirLoopNum).DesCoolVolFlow;
    1399            0 :             state.dataSize->VpzClgSumBySys(AirLoopNum) = state.dataSize->VdzClgByZone(termUnitSizingIndex);
    1400              :             // single zone heating
    1401            0 :             state.dataSize->VotHtgBySys(AirLoopNum) = VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffHeating;
    1402            0 :             state.dataSize->EvzByZoneHeat(termUnitSizingIndex) = thisTermUnitFinalZoneSizing.ZoneADEffHeating;
    1403            0 :             state.dataSize->EvzMinBySysHeat(AirLoopNum) = state.dataSize->EvzByZoneHeat(termUnitSizingIndex);
    1404            0 :             state.dataSize->VpsHtgBySys(AirLoopNum) = state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
    1405            0 :             state.dataSize->VpzHtgSumBySys(AirLoopNum) = state.dataSize->VpzHtgByZone(termUnitSizingIndex);
    1406              : 
    1407              :             // the design zone ventilation value is based on the larger of the system-level cooling Vot and/or heating Vot
    1408            0 :             FinalSysSizing(AirLoopNum).DesOutAirVolFlow = max(state.dataSize->VotClgBySys(AirLoopNum), state.dataSize->VotHtgBySys(AirLoopNum));
    1409              :             // Fill Xs values for reporting
    1410            0 :             state.dataSize->XsBySysCool(AirLoopNum) = FinalSysSizing(AirLoopNum).DesOutAirVolFlow / state.dataSize->VpsClgBySys(AirLoopNum);
    1411            0 :             state.dataSize->XsBySysHeat(AirLoopNum) = FinalSysSizing(AirLoopNum).DesOutAirVolFlow / state.dataSize->VpsHtgBySys(AirLoopNum);
    1412              : 
    1413              :         } else { // not vrp, zone sum, fill out values that still apply
    1414              :             // redo VpzClgSumBySys( AirLoopNum ) with latest values, for reporting
    1415          960 :             state.dataSize->VpzClgSumBySys(AirLoopNum) = 0.0;
    1416              :             // Fill Vps for cooling VRP calculation, use cooling design flow rate as adjusted in ManageSystemSizingAdjustments ( to use
    1417              :             // coincident sizing result if available for block air flow
    1418          960 :             state.dataSize->VpsClgBySys(AirLoopNum) = FinalSysSizing(AirLoopNum).DesCoolVolFlow;
    1419              :             // Fill Vps for heating VRP calculation, use heating min by zone from air terminal scan in ManageSystemSizingAdjustments
    1420          960 :             state.dataSize->VpsHtgBySys(AirLoopNum) = 0.0;
    1421          960 :             state.dataSize->VpzHtgSumBySys(AirLoopNum) = 0.0; // for reporting only
    1422         4163 :             for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++zoneNum) {
    1423         3203 :                 int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
    1424         3203 :                 state.dataSize->VpzClgSumBySys(AirLoopNum) += state.dataSize->VdzClgByZone(termUnitSizingIndex);
    1425         3203 :                 state.dataSize->VpsHtgBySys(AirLoopNum) += state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
    1426         3203 :                 state.dataSize->VpzHtgSumBySys(AirLoopNum) += state.dataSize->VpzHtgByZone(termUnitSizingIndex);
    1427              :             }
    1428          974 :             for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesHeated; ++zoneNum) {
    1429           14 :                 int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
    1430           14 :                 int MatchingCooledZoneNum = General::FindNumberInList(
    1431           14 :                     termUnitSizingIndex, AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex, AirToZoneNodeInfo(AirLoopNum).NumZonesCooled);
    1432           14 :                 if (MatchingCooledZoneNum == 0) {
    1433            0 :                     state.dataSize->VpzClgSumBySys(AirLoopNum) += state.dataSize->VdzClgByZone(termUnitSizingIndex);
    1434            0 :                     state.dataSize->VpsHtgBySys(AirLoopNum) += state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
    1435            0 :                     state.dataSize->VpzHtgSumBySys(AirLoopNum) += state.dataSize->VpzHtgByZone(termUnitSizingIndex);
    1436              :                 }
    1437              :             }
    1438              :         }
    1439              :     } // airloop loop
    1440              : 
    1441              :     // write out predefined standard 62.1 report data, total of 8 tables
    1442         1769 :     for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
    1443              : 
    1444              :         // System Ventilation Requirements for Cooling (table 1)
    1445          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1446          969 :                                                  state.dataOutRptPredefined->pdchS62svrClSumVpz,
    1447          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1448          969 :                                                  state.dataSize->VpzClgSumBySys(AirLoopNum),
    1449          969 :                                                  4); // Vpz-sum
    1450          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1451          969 :                                                  state.dataOutRptPredefined->pdchS62svrClPs,
    1452          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1453          969 :                                                  state.dataSize->PsBySys(AirLoopNum),
    1454          969 :                                                  4); // Ps
    1455          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1456          969 :                                                  state.dataOutRptPredefined->pdchS62svrClSumPz,
    1457          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1458          969 :                                                  state.dataSize->PzSumBySys(AirLoopNum),
    1459          969 :                                                  4); // Pz-sum
    1460          969 :         OutputReportPredefined::PreDefTableEntry(
    1461          969 :             state, state.dataOutRptPredefined->pdchS62svrClD, FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->DBySys(AirLoopNum), 4); // D
    1462              :         // Origin of D
    1463              :         int SysSizNum =
    1464          969 :             Util::FindItemInList(FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
    1465          969 :         if (SysSizNum == 0) {
    1466            4 :             SysSizNum = 1; // use first when none applicable
    1467              :         }
    1468          969 :         if (state.dataSize->SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
    1469         1934 :             OutputReportPredefined::PreDefTableEntry(
    1470          967 :                 state, state.dataOutRptPredefined->pdchS62svrClDorg, FinalSysSizing(AirLoopNum).AirPriLoopName, "Calculated from schedules");
    1471              :         } else {
    1472            4 :             OutputReportPredefined::PreDefTableEntry(
    1473            2 :                 state, state.dataOutRptPredefined->pdchS62svrClDorg, FinalSysSizing(AirLoopNum).AirPriLoopName, "User-specified");
    1474              :         }
    1475          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1476          969 :                                                  state.dataOutRptPredefined->pdchS62svrClVou,
    1477          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1478          969 :                                                  state.dataSize->VouBySys(AirLoopNum),
    1479          969 :                                                  4); // Vou
    1480          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1481          969 :                                                  state.dataOutRptPredefined->pdchS62svrClVps,
    1482          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1483          969 :                                                  state.dataSize->VpsClgBySys(AirLoopNum),
    1484          969 :                                                  4); // Vps
    1485          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1486          969 :                                                  state.dataOutRptPredefined->pdchS62svrClXs,
    1487          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1488          969 :                                                  state.dataSize->XsBySysCool(AirLoopNum),
    1489          969 :                                                  4); // Xs
    1490          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1491          969 :                                                  state.dataOutRptPredefined->pdchS62svrClEv,
    1492          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1493          969 :                                                  state.dataSize->EvzMinBySysCool(AirLoopNum),
    1494          969 :                                                  4); // Ev
    1495              :         // Ev Calculation Methodology
    1496          969 :         if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::VRP) {
    1497           14 :             OutputReportPredefined::PreDefTableEntry(state,
    1498            7 :                                                      state.dataOutRptPredefined->pdchS62svrClEvMthd,
    1499            7 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1500              :                                                      "Standard 62.1 Ventilation Rate Procedure");
    1501          962 :         } else if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::SP) {
    1502            6 :             OutputReportPredefined::PreDefTableEntry(state,
    1503            3 :                                                      state.dataOutRptPredefined->pdchS62svrClEvMthd,
    1504            3 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1505              :                                                      "Standard 62.1 Simplified Procedure");
    1506              :         } else {
    1507         1918 :             OutputReportPredefined::PreDefTableEntry(
    1508          959 :                 state, state.dataOutRptPredefined->pdchS62svrClEvMthd, FinalSysSizing(AirLoopNum).AirPriLoopName, "Not calculated");
    1509              :         }
    1510          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1511          969 :                                                  state.dataOutRptPredefined->pdchS62svrClVot,
    1512          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1513          969 :                                                  state.dataSize->VotClgBySys(AirLoopNum),
    1514          969 :                                                  4);          // Vot
    1515          969 :         if (state.dataSize->VpsClgBySys(AirLoopNum) != 0.0) { // Move here
    1516          969 :             OutputReportPredefined::PreDefTableEntry(state,
    1517          969 :                                                      state.dataOutRptPredefined->pdchS62svrClPercOA,
    1518          969 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1519          969 :                                                      state.dataSize->VotClgBySys(AirLoopNum) / state.dataSize->VpsClgBySys(AirLoopNum),
    1520         1938 :                                                      4); //%OA
    1521              :         }
    1522          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1523          969 :                                                  state.dataOutRptPredefined->pdchS62svrClEnvironmentOfPs,
    1524          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1525          969 :                                                  state.dataSize->PeakPsOccurrenceEnvironmentStringBySys(AirLoopNum));
    1526          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1527          969 :                                                  state.dataOutRptPredefined->pdchS62svrClTimeOfPs,
    1528          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1529          969 :                                                  state.dataSize->PeakPsOccurrenceDateTimeStringBySys(AirLoopNum));
    1530              : 
    1531              :         // system ventilation requirements for heating ( table 2 )
    1532          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1533          969 :                                                  state.dataOutRptPredefined->pdchS62svrHtSumVpz,
    1534          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1535          969 :                                                  state.dataSize->VpzHtgSumBySys(AirLoopNum),
    1536          969 :                                                  4); // Vpz-sum
    1537          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1538          969 :                                                  state.dataOutRptPredefined->pdchS62svrHtPs,
    1539          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1540          969 :                                                  state.dataSize->PsBySys(AirLoopNum),
    1541          969 :                                                  4); // Ps
    1542          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1543          969 :                                                  state.dataOutRptPredefined->pdchS62svrHtSumPz,
    1544          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1545          969 :                                                  state.dataSize->PzSumBySys(AirLoopNum),
    1546          969 :                                                  4); // Pz-sum
    1547          969 :         OutputReportPredefined::PreDefTableEntry(
    1548          969 :             state, state.dataOutRptPredefined->pdchS62svrHtD, FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->DBySys(AirLoopNum), 4); // D
    1549              :         // Origin of D
    1550          969 :         if (state.dataSize->SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
    1551         1934 :             OutputReportPredefined::PreDefTableEntry(
    1552          967 :                 state, state.dataOutRptPredefined->pdchS62svrHtDorg, FinalSysSizing(AirLoopNum).AirPriLoopName, "Calculated from schedules");
    1553              :         } else {
    1554            4 :             OutputReportPredefined::PreDefTableEntry(
    1555            2 :                 state, state.dataOutRptPredefined->pdchS62svrHtDorg, FinalSysSizing(AirLoopNum).AirPriLoopName, "User-specified");
    1556              :         }
    1557          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1558          969 :                                                  state.dataOutRptPredefined->pdchS62svrHtVou,
    1559          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1560          969 :                                                  state.dataSize->VouBySys(AirLoopNum),
    1561          969 :                                                  4); // Vou
    1562          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1563          969 :                                                  state.dataOutRptPredefined->pdchS62svrHtVps,
    1564          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1565          969 :                                                  state.dataSize->VpsHtgBySys(AirLoopNum),
    1566          969 :                                                  4); // Vps
    1567          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1568          969 :                                                  state.dataOutRptPredefined->pdchS62svrHtXs,
    1569          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1570          969 :                                                  state.dataSize->XsBySysHeat(AirLoopNum),
    1571          969 :                                                  4); // Xs
    1572          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1573          969 :                                                  state.dataOutRptPredefined->pdchS62svrHtEv,
    1574          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1575          969 :                                                  state.dataSize->EvzMinBySysHeat(AirLoopNum),
    1576          969 :                                                  4); // Ev
    1577              :         // Ev Calculation Methodology
    1578          969 :         if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::VRP) {
    1579           14 :             OutputReportPredefined::PreDefTableEntry(state,
    1580            7 :                                                      state.dataOutRptPredefined->pdchS62svrHtEvMthd,
    1581            7 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1582              :                                                      "Standard 62.1 Ventilation Rate Procedure");
    1583          962 :         } else if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::SP) {
    1584            6 :             OutputReportPredefined::PreDefTableEntry(state,
    1585            3 :                                                      state.dataOutRptPredefined->pdchS62svrHtEvMthd,
    1586            3 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1587              :                                                      "Standard 62.1 Simplified Procedure");
    1588              :         } else {
    1589         1918 :             OutputReportPredefined::PreDefTableEntry(
    1590          959 :                 state, state.dataOutRptPredefined->pdchS62svrHtEvMthd, FinalSysSizing(AirLoopNum).AirPriLoopName, "Not calculated");
    1591              :         }
    1592          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1593          969 :                                                  state.dataOutRptPredefined->pdchS62svrHtVot,
    1594          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1595          969 :                                                  state.dataSize->VotHtgBySys(AirLoopNum),
    1596          969 :                                                  4); // Vot
    1597          969 :         if (state.dataSize->VpsHtgBySys(AirLoopNum) != 0.0) {
    1598          968 :             OutputReportPredefined::PreDefTableEntry(state,
    1599          968 :                                                      state.dataOutRptPredefined->pdchS62svrHtPercOA,
    1600          968 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1601          968 :                                                      state.dataSize->VotHtgBySys(AirLoopNum) / state.dataSize->VpsHtgBySys(AirLoopNum),
    1602         1936 :                                                      4); //%OA
    1603              :         }
    1604              :         // heating time of peak Ps is the same as for cooling (for now)
    1605          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1606          969 :                                                  state.dataOutRptPredefined->pdchS62svrHtEnvironmentOfPs,
    1607          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1608          969 :                                                  state.dataSize->PeakPsOccurrenceEnvironmentStringBySys(AirLoopNum));
    1609          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1610          969 :                                                  state.dataOutRptPredefined->pdchS62svrHtTimeOfPs,
    1611          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1612          969 :                                                  state.dataSize->PeakPsOccurrenceDateTimeStringBySys(AirLoopNum));
    1613              : 
    1614              :         // Zone ventilation parameters, (table 3)
    1615              :         // make two passes, one for cooled zones and one for heated zones, if a zone is the same on the second pass, skip it
    1616         2907 :         for (int coolHeatPass = 1; coolHeatPass <= 2; ++coolHeatPass) {
    1617         1938 :             int numZones = 0;
    1618         1938 :             if (coolHeatPass == 1) {
    1619          969 :                 numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesCooled;
    1620              :             } else {
    1621          969 :                 numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesHeated;
    1622              :             }
    1623         5195 :             for (int zoneNum = 1; zoneNum <= numZones; ++zoneNum) {
    1624         3257 :                 int termUnitSizingIndex = 0;
    1625         3257 :                 int MatchingCooledZoneNum = 0;
    1626         3257 :                 if (coolHeatPass == 1) {
    1627         3243 :                     termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
    1628              :                 } else {
    1629           14 :                     termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
    1630           14 :                     MatchingCooledZoneNum = General::FindNumberInList(
    1631           14 :                         termUnitSizingIndex, AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex, AirToZoneNodeInfo(AirLoopNum).NumZonesCooled);
    1632              :                 }
    1633         3257 :                 if (MatchingCooledZoneNum == 0) {
    1634         3243 :                     auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
    1635         6486 :                     OutputReportPredefined::PreDefTableEntry(state,
    1636         3243 :                                                              state.dataOutRptPredefined->pdchS62zvpAlN,
    1637              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1638         3243 :                                                              state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name); // Air loop name
    1639         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1640         3243 :                                                              state.dataOutRptPredefined->pdchS62zvpRp,
    1641              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1642         3243 :                                                              thisTermUnitFinalZoneSizing.DesOAFlowPPer,
    1643         3243 :                                                              6); // Rp
    1644         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1645         3243 :                                                              state.dataOutRptPredefined->pdchS62zvpPz,
    1646              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1647         3243 :                                                              thisTermUnitFinalZoneSizing.TotPeopleInZone,
    1648         3243 :                                                              4); // Pz
    1649         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1650         3243 :                                                              state.dataOutRptPredefined->pdchS62zvpRa,
    1651              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1652         3243 :                                                              thisTermUnitFinalZoneSizing.DesOAFlowPerArea,
    1653         3243 :                                                              6); // Ra
    1654         6486 :                     OutputReportPredefined::PreDefTableEntry(state,
    1655         3243 :                                                              state.dataOutRptPredefined->pdchS62zvpAz,
    1656              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1657         3243 :                                                              thisTermUnitFinalZoneSizing.TotalZoneFloorArea); // Az
    1658         3243 :                     OutputReportPredefined::PreDefTableEntry(
    1659              :                         state,
    1660         3243 :                         state.dataOutRptPredefined->pdchS62zvpVbz,
    1661              :                         thisTermUnitFinalZoneSizing.ZoneName,
    1662         3243 :                         VbzByZone(termUnitSizingIndex),
    1663         3243 :                         4); // Vbz, now corrected so that Vbz does not already have system population term multiplied into it
    1664         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1665         3243 :                                                              state.dataOutRptPredefined->pdchS62zvpClEz,
    1666              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1667         3243 :                                                              thisTermUnitFinalZoneSizing.ZoneADEffCooling,
    1668         3243 :                                                              4); // Ez-clg
    1669         3243 :                     if (thisTermUnitFinalZoneSizing.ZoneADEffCooling > 0.0) {
    1670         3243 :                         OutputReportPredefined::PreDefTableEntry(state,
    1671         3243 :                                                                  state.dataOutRptPredefined->pdchS62zvpClVoz,
    1672              :                                                                  thisTermUnitFinalZoneSizing.ZoneName,
    1673         3243 :                                                                  VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffCooling,
    1674         6486 :                                                                  4); // Voz-clg
    1675              :                     }
    1676         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1677         3243 :                                                              state.dataOutRptPredefined->pdchS62zvpHtEz,
    1678              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1679         3243 :                                                              thisTermUnitFinalZoneSizing.ZoneADEffHeating,
    1680         3243 :                                                              3); // Ez-htg
    1681         3243 :                     if (thisTermUnitFinalZoneSizing.ZoneADEffHeating != 0.0) {
    1682         3243 :                         OutputReportPredefined::PreDefTableEntry(state,
    1683         3243 :                                                                  state.dataOutRptPredefined->pdchS62zvpHtVoz,
    1684              :                                                                  thisTermUnitFinalZoneSizing.ZoneName,
    1685         3243 :                                                                  VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffHeating,
    1686         6486 :                                                                  4); // Voz-htg
    1687              :                     }
    1688              :                 }
    1689              :             }
    1690              :         }
    1691              : 
    1692              :         // System Ventilation Parameters, (Table 4)
    1693              : 
    1694              :         // first do some summations needed
    1695          969 :         Real64 RpPzSum(0.0);
    1696          969 :         Real64 RaAzSum(0.0);
    1697          969 :         Real64 AzSum(0.0);
    1698          969 :         Real64 VbzSum(0.0);
    1699          969 :         Real64 VozClgSum(0.0);
    1700          969 :         Real64 VozHtgSum(0.0);
    1701          969 :         Real64 VdzClgSum(0.0);
    1702          969 :         Real64 VdzHtgSum(0.0);
    1703          969 :         Real64 VpzMinClgSum(0.0);
    1704          969 :         Real64 VpzMinHtgSum(0.0);
    1705              :         // make two passes, one for cooled zones and one for heated zones, if a zone is the same on the second pass, skip it
    1706         2907 :         for (int coolHeatPass = 1; coolHeatPass <= 2; ++coolHeatPass) {
    1707         1938 :             int numZones = 0;
    1708         1938 :             if (coolHeatPass == 1) {
    1709          969 :                 numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesCooled;
    1710              :             } else {
    1711          969 :                 numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesHeated;
    1712              :             }
    1713         5195 :             for (int airLoopZoneNum = 1; airLoopZoneNum <= numZones; ++airLoopZoneNum) {
    1714         3257 :                 int termUnitSizingIndex = 0;
    1715         3257 :                 int MatchingCooledZoneNum = 0;
    1716         3257 :                 if (coolHeatPass == 1) {
    1717         3243 :                     termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(airLoopZoneNum);
    1718              :                 } else {
    1719           14 :                     termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(airLoopZoneNum);
    1720           14 :                     MatchingCooledZoneNum = General::FindNumberInList(
    1721           14 :                         termUnitSizingIndex, AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex, AirToZoneNodeInfo(AirLoopNum).NumZonesCooled);
    1722              :                 }
    1723         3257 :                 if (MatchingCooledZoneNum == 0) {
    1724         3243 :                     auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
    1725              :                     // Zone ventilation parameters, (table 3)
    1726         3243 :                     RpPzSum += thisTermUnitFinalZoneSizing.DesOAFlowPPer * thisTermUnitFinalZoneSizing.TotPeopleInZone;
    1727         3243 :                     RaAzSum += thisTermUnitFinalZoneSizing.DesOAFlowPerArea * thisTermUnitFinalZoneSizing.TotalZoneFloorArea;
    1728         3243 :                     AzSum += thisTermUnitFinalZoneSizing.TotalZoneFloorArea;
    1729         3243 :                     VbzSum += VbzByZone(termUnitSizingIndex);
    1730         3243 :                     if (thisTermUnitFinalZoneSizing.ZoneADEffCooling != 0.0) {
    1731         3243 :                         VozClgSum += VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffCooling;
    1732              :                     }
    1733         3243 :                     if (thisTermUnitFinalZoneSizing.ZoneADEffHeating != 0.0) {
    1734         3243 :                         VozHtgSum += VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffHeating;
    1735              :                     }
    1736              : 
    1737         3243 :                     VpzMinClgSum += state.dataSize->VpzMinClgByZone(termUnitSizingIndex);
    1738         3243 :                     VdzClgSum += state.dataSize->VdzClgByZone(termUnitSizingIndex);
    1739         3243 :                     VpzMinHtgSum += state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
    1740         3243 :                     VdzHtgSum += state.dataSize->VdzMinHtgByZone(termUnitSizingIndex);
    1741              : 
    1742              :                     // Zone Ventilation Calculations for Cooling Design, (Table 5)
    1743         6486 :                     OutputReportPredefined::PreDefTableEntry(state,
    1744         3243 :                                                              state.dataOutRptPredefined->pdchS62zcdAlN,
    1745              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1746         3243 :                                                              AirToZoneNodeInfo(AirLoopNum).AirLoopName); // Air loop name
    1747        61163 :                     for (int iAirDistUnit = 1; iAirDistUnit <= (int)state.dataDefineEquipment->AirDistUnit.size(); ++iAirDistUnit) {
    1748        61163 :                         if (AirDistUnit(iAirDistUnit).TermUnitSizingNum == termUnitSizingIndex) {
    1749         6486 :                             OutputReportPredefined::PreDefTableEntry(state,
    1750         3243 :                                                                      state.dataOutRptPredefined->pdchS62zcdBox,
    1751              :                                                                      thisTermUnitFinalZoneSizing.ZoneName,
    1752         3243 :                                                                      AirDistUnit(iAirDistUnit).EquipType(1)); // use first type of equipment listed
    1753         3243 :                             break; // if it has been found no more searching is needed
    1754              :                         }
    1755              :                     }
    1756         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1757         3243 :                                                              state.dataOutRptPredefined->pdchS62zcdVpz,
    1758              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1759         3243 :                                                              state.dataSize->VpzClgByZone(termUnitSizingIndex),
    1760         3243 :                                                              4); // Vpz LS:
    1761         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1762         3243 :                                                              state.dataOutRptPredefined->pdchS62zcdVdz,
    1763              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1764         3243 :                                                              state.dataSize->VdzClgByZone(termUnitSizingIndex),
    1765         3243 :                                                              4); // Vdz
    1766         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1767         3243 :                                                              state.dataOutRptPredefined->pdchS62zcdVpzmin,
    1768              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1769         3243 :                                                              state.dataSize->VpzMinClgByZone(termUnitSizingIndex),
    1770         3243 :                                                              4); // Vpz-min
    1771              :                     // Vpz-min, simplified procedure?
    1772         3243 :                     if (thisTermUnitFinalZoneSizing.VpzMinByZoneSPSized) {
    1773           16 :                         OutputReportPredefined::PreDefTableEntry(
    1774            8 :                             state, state.dataOutRptPredefined->pdchS62zcdVpzminSPSize, thisTermUnitFinalZoneSizing.ZoneName, "Yes");
    1775              :                     } else {
    1776         6470 :                         OutputReportPredefined::PreDefTableEntry(
    1777         3235 :                             state, state.dataOutRptPredefined->pdchS62zcdVpzminSPSize, thisTermUnitFinalZoneSizing.ZoneName, "No");
    1778              :                     }
    1779         3243 :                     Real64 VozClg = 0.0;
    1780         3243 :                     if (thisTermUnitFinalZoneSizing.ZoneADEffCooling > 0.0) {
    1781         3243 :                         VozClg = VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffCooling;
    1782         6486 :                         OutputReportPredefined::PreDefTableEntry(state,
    1783         3243 :                                                                  state.dataOutRptPredefined->pdchS62zcdVozclg,
    1784              :                                                                  thisTermUnitFinalZoneSizing.ZoneName,
    1785              :                                                                  VozClg,
    1786         6486 :                                                                  4); // Voz-clg
    1787              :                     }
    1788         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1789         3243 :                                                              state.dataOutRptPredefined->pdchS62zcdZpz,
    1790              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1791         3243 :                                                              state.dataSize->ZdzClgByZone(termUnitSizingIndex),
    1792         3243 :                                                              4); // Zpz = Voz/Vpz (see eq 6-5 in 62.1-2010)
    1793         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1794         3243 :                                                              state.dataOutRptPredefined->pdchS62zcdEp,
    1795              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1796         3243 :                                                              thisTermUnitFinalZoneSizing.ZonePrimaryAirFraction,
    1797         3243 :                                                              4); // Ep
    1798         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1799         3243 :                                                              state.dataOutRptPredefined->pdchS62zcdEr,
    1800              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1801         3243 :                                                              thisTermUnitFinalZoneSizing.ZoneSecondaryRecirculation,
    1802         3243 :                                                              4); // Er
    1803         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1804         3243 :                                                              state.dataOutRptPredefined->pdchS62zcdFa,
    1805              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1806         3243 :                                                              state.dataSize->FaByZoneCool(termUnitSizingIndex),
    1807         3243 :                                                              4); // Fa
    1808         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1809         3243 :                                                              state.dataOutRptPredefined->pdchS62zcdFb,
    1810              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1811         3243 :                                                              state.dataSize->FbByZoneCool(termUnitSizingIndex),
    1812         3243 :                                                              4); // Fb
    1813         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1814         3243 :                                                              state.dataOutRptPredefined->pdchS62zcdFc,
    1815              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1816         3243 :                                                              state.dataSize->FcByZoneCool(termUnitSizingIndex),
    1817         3243 :                                                              4); // Fc
    1818         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1819         3243 :                                                              state.dataOutRptPredefined->pdchS62zcdEvz,
    1820              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1821         3243 :                                                              state.dataSize->EvzByZoneCool(termUnitSizingIndex),
    1822         3243 :                                                              4); // Evz
    1823              : 
    1824              :                     // Zone Ventilation Calculations for Heating Design (Table 7)
    1825         6486 :                     OutputReportPredefined::PreDefTableEntry(state,
    1826         3243 :                                                              state.dataOutRptPredefined->pdchS62zhdAlN,
    1827              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1828         3243 :                                                              AirToZoneNodeInfo(AirLoopNum).AirLoopName); // Air loop name
    1829        61163 :                     for (int iAirDistUnit = 1; iAirDistUnit <= (int)state.dataDefineEquipment->AirDistUnit.size(); ++iAirDistUnit) {
    1830        61163 :                         if (AirDistUnit(iAirDistUnit).TermUnitSizingNum == termUnitSizingIndex) {
    1831         6486 :                             OutputReportPredefined::PreDefTableEntry(state,
    1832         3243 :                                                                      state.dataOutRptPredefined->pdchS62zhdBox,
    1833              :                                                                      thisTermUnitFinalZoneSizing.ZoneName,
    1834         3243 :                                                                      AirDistUnit(iAirDistUnit).EquipType(1)); // use first type of equipment listed
    1835         3243 :                             break; // if it has been found no more searching is needed
    1836              :                         }
    1837              :                     }
    1838         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1839         3243 :                                                              state.dataOutRptPredefined->pdchS62zhdVpz,
    1840              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1841         3243 :                                                              state.dataSize->VpzHtgByZone(termUnitSizingIndex),
    1842         3243 :                                                              4); // Vpz
    1843         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1844         3243 :                                                              state.dataOutRptPredefined->pdchS62zhdVdz,
    1845              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1846         3243 :                                                              state.dataSize->VdzHtgByZone(termUnitSizingIndex),
    1847         3243 :                                                              4); // Vdz
    1848         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1849         3243 :                                                              state.dataOutRptPredefined->pdchS62zhdVpzmin,
    1850              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1851         3243 :                                                              state.dataSize->VpzMinHtgByZone(termUnitSizingIndex),
    1852         3243 :                                                              4); // Vpz-min
    1853              :                     // Vpz-min, simplified procedure?
    1854         3243 :                     if (thisTermUnitFinalZoneSizing.VpzMinByZoneSPSized) {
    1855           16 :                         OutputReportPredefined::PreDefTableEntry(
    1856            8 :                             state, state.dataOutRptPredefined->pdchS62zhdVpzminSPSize, thisTermUnitFinalZoneSizing.ZoneName, "Yes");
    1857              :                     } else {
    1858         6470 :                         OutputReportPredefined::PreDefTableEntry(
    1859         3235 :                             state, state.dataOutRptPredefined->pdchS62zhdVpzminSPSize, thisTermUnitFinalZoneSizing.ZoneName, "No");
    1860              :                     }
    1861         3243 :                     Real64 VozHtg = 0.0;
    1862         3243 :                     if (thisTermUnitFinalZoneSizing.ZoneADEffHeating != 0.0) {
    1863         3243 :                         VozHtg = VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffHeating;
    1864         6486 :                         OutputReportPredefined::PreDefTableEntry(state,
    1865         3243 :                                                                  state.dataOutRptPredefined->pdchS62zhdVozhtg,
    1866              :                                                                  thisTermUnitFinalZoneSizing.ZoneName,
    1867              :                                                                  VozHtg,
    1868         6486 :                                                                  4); // Voz-htg
    1869              :                     }
    1870              :                     // Outdoor Air Details Report - Design Zone Outdoor Airflow - Voz
    1871         3243 :                     int const zoneMult = state.dataHeatBal->Zone(thisTermUnitFinalZoneSizing.ZoneNum).Multiplier *
    1872         3243 :                                          state.dataHeatBal->Zone(thisTermUnitFinalZoneSizing.ZoneNum).ListMultiplier;
    1873         3243 :                     Real64 VozMax = std::max(VozHtg, VozClg); // take larger of the heating and cooling Voz values
    1874         6486 :                     OutputReportPredefined::PreDefTableEntry(
    1875         6486 :                         state, state.dataOutRptPredefined->pdchOaMvDesZnOa, thisTermUnitFinalZoneSizing.ZoneName, VozMax / zoneMult, 4);
    1876         3243 :                     state.dataOutRptPredefined->TotalVozMax += VozMax;
    1877         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1878         3243 :                                                              state.dataOutRptPredefined->pdchS62zhdZpz,
    1879              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1880         3243 :                                                              thisTermUnitFinalZoneSizing.ZpzHtgByZone,
    1881         3243 :                                                              4); // Zpz = Voz/Vpz (see eq 6-5 in 62.1-2010)
    1882         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1883         3243 :                                                              state.dataOutRptPredefined->pdchS62zhdEp,
    1884              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1885         3243 :                                                              thisTermUnitFinalZoneSizing.ZonePrimaryAirFractionHtg,
    1886         3243 :                                                              4); // Ep
    1887         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1888         3243 :                                                              state.dataOutRptPredefined->pdchS62zhdEr,
    1889              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1890         3243 :                                                              thisTermUnitFinalZoneSizing.ZoneSecondaryRecirculation,
    1891         3243 :                                                              4); // Er
    1892         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1893         3243 :                                                              state.dataOutRptPredefined->pdchS62zhdFa,
    1894              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1895         3243 :                                                              state.dataSize->FaByZoneHeat(termUnitSizingIndex),
    1896         3243 :                                                              4); // Fa
    1897         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1898         3243 :                                                              state.dataOutRptPredefined->pdchS62zhdFb,
    1899              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1900         3243 :                                                              state.dataSize->FbByZoneHeat(termUnitSizingIndex),
    1901         3243 :                                                              4); // Fb
    1902         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1903         3243 :                                                              state.dataOutRptPredefined->pdchS62zhdFc,
    1904              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1905         3243 :                                                              state.dataSize->FcByZoneHeat(termUnitSizingIndex),
    1906         3243 :                                                              4); // Fc
    1907         3243 :                     OutputReportPredefined::PreDefTableEntry(state,
    1908         3243 :                                                              state.dataOutRptPredefined->pdchS62zhdEvz,
    1909              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1910         3243 :                                                              state.dataSize->EvzByZoneHeat(termUnitSizingIndex),
    1911         6486 :                                                              4); // Evz
    1912              :                 }
    1913              :             }
    1914              :         }
    1915              : 
    1916              :         // System Ventilation Parameters, (Table 4)
    1917          969 :         if (state.dataSize->PzSumBySys(AirLoopNum) != 0.0) {
    1918          897 :             OutputReportPredefined::PreDefTableEntry(state,
    1919          897 :                                                      state.dataOutRptPredefined->pdchS62svpRp,
    1920          897 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1921          897 :                                                      RpPzSum / state.dataSize->PzSumBySys(AirLoopNum),
    1922         1794 :                                                      6); // Average Rp for system
    1923              :         }
    1924         1938 :         OutputReportPredefined::PreDefTableEntry(
    1925          969 :             state, state.dataOutRptPredefined->pdchS62svpPz, FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->PzSumBySys(AirLoopNum));
    1926          969 :         if (AzSum != 0.0) {
    1927          969 :             OutputReportPredefined::PreDefTableEntry(state,
    1928          969 :                                                      state.dataOutRptPredefined->pdchS62svpRa,
    1929          969 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1930              :                                                      RaAzSum / AzSum,
    1931         1938 :                                                      6); // average Ra for system
    1932              :         }
    1933          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1934          969 :                                                  state.dataOutRptPredefined->pdchS62svpAz,
    1935          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1936              :                                                  AzSum,
    1937          969 :                                                  4); // Az sum
    1938          969 :         OutputReportPredefined::PreDefTableEntry(
    1939          969 :             state, state.dataOutRptPredefined->pdchS62svpVbz, FinalSysSizing(AirLoopNum).AirPriLoopName, VbzSum, 4);
    1940          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1941          969 :                                                  state.dataOutRptPredefined->pdchS62svpClVoz,
    1942          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1943              :                                                  VozClgSum,
    1944          969 :                                                  4); // Voz-clg
    1945          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1946          969 :                                                  state.dataOutRptPredefined->pdchS62svpHtVoz,
    1947          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1948              :                                                  VozHtgSum,
    1949          969 :                                                  4); // Voz-htg
    1950              : 
    1951              :         // System Ventilation Calculations for Cooling Design (Table 6)
    1952          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1953          969 :                                                  state.dataOutRptPredefined->pdchS62scdVpz,
    1954          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1955          969 :                                                  state.dataSize->VpzClgSumBySys(AirLoopNum),
    1956          969 :                                                  4); // Vpz-sum
    1957          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1958          969 :                                                  state.dataOutRptPredefined->pdchS62scdVps,
    1959          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1960          969 :                                                  state.dataSize->VpsClgBySys(AirLoopNum),
    1961          969 :                                                  4); // Vps
    1962          969 :         OutputReportPredefined::PreDefTableEntry(
    1963          969 :             state, state.dataOutRptPredefined->pdchS62scdVpzmin, FinalSysSizing(AirLoopNum).AirPriLoopName, VpzMinClgSum, 4); // Vpz-min
    1964          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1965          969 :                                                  state.dataOutRptPredefined->pdchS62scdVdz,
    1966          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1967              :                                                  VdzClgSum,
    1968          969 :                                                  4); // Vdz-sum
    1969          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1970          969 :                                                  state.dataOutRptPredefined->pdchS62scdVozclg,
    1971          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1972              :                                                  VozClgSum,
    1973          969 :                                                  4); // Voz-clg
    1974          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1975          969 :                                                  state.dataOutRptPredefined->pdchS62scdEvz,
    1976          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1977          969 :                                                  state.dataSize->EvzMinBySysCool(AirLoopNum),
    1978          969 :                                                  4); // Evz-min
    1979              : 
    1980              :         // System Ventilation Calculations for Heating Design (Table 8)
    1981          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1982          969 :                                                  state.dataOutRptPredefined->pdchS62shdVpz,
    1983          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1984          969 :                                                  state.dataSize->VpzHtgSumBySys(AirLoopNum),
    1985          969 :                                                  4); // Vpz-sum
    1986          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1987          969 :                                                  state.dataOutRptPredefined->pdchS62shdVps,
    1988          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1989          969 :                                                  state.dataSize->VpsHtgBySys(AirLoopNum),
    1990          969 :                                                  4); // Vps
    1991          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1992          969 :                                                  state.dataOutRptPredefined->pdchS62shdVdz,
    1993          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1994              :                                                  VdzHtgSum,
    1995          969 :                                                  4); // Vdz-sum
    1996          969 :         OutputReportPredefined::PreDefTableEntry(
    1997          969 :             state, state.dataOutRptPredefined->pdchS62shdVpzmin, FinalSysSizing(AirLoopNum).AirPriLoopName, VpzMinHtgSum, 4); // Vpz-min
    1998          969 :         OutputReportPredefined::PreDefTableEntry(state,
    1999          969 :                                                  state.dataOutRptPredefined->pdchS62shdVozhtg,
    2000          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    2001              :                                                  VozHtgSum,
    2002          969 :                                                  4); // Voz-htg
    2003          969 :         OutputReportPredefined::PreDefTableEntry(state,
    2004          969 :                                                  state.dataOutRptPredefined->pdchS62shdEvz,
    2005          969 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    2006          969 :                                                  state.dataSize->EvzMinBySysHeat(AirLoopNum),
    2007         1938 :                                                  4); // Evz-min
    2008              : 
    2009              :     } // loop over air loops for table writing
    2010          800 : }
    2011              : 
    2012          347 : void DetermineSystemPopulationDiversity(EnergyPlusData &state)
    2013              : {
    2014              : 
    2015              :     // determine Pz sum, Ps, and D for each air system for standard 62.1
    2016              : 
    2017              :     // first determine if any airloops use VRP, if not then don't need to march thru year of schedules for performance
    2018          347 :     bool anyVRPinModel(false);
    2019         1306 :     for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
    2020          966 :         auto const &finalSysSizing = state.dataSize->FinalSysSizing(AirLoopNum);
    2021          966 :         if (finalSysSizing.SystemOAMethod == SysOAMethod::VRP || finalSysSizing.SystemOAMethod == SysOAMethod::SP) {
    2022            7 :             anyVRPinModel = true;
    2023            7 :             break;
    2024              :         }
    2025              :     }
    2026              :     // First get the design (max) level of people in all zones connected to air loop
    2027         1316 :     for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
    2028          969 :         auto const &finalSysSizing = state.dataSize->FinalSysSizing(AirLoopNum);
    2029          969 :         int SysSizNum = Util::FindItemInList(finalSysSizing.AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
    2030          969 :         if (SysSizNum == 0) {
    2031            4 :             SysSizNum = 1; // use first when none applicable
    2032              :         }
    2033              :         // only retrieve data if the occupant density is set to be autosized
    2034          969 :         if (finalSysSizing.OAAutoSized && state.dataSize->SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
    2035          929 :             auto &pzSumBySys = state.dataSize->PzSumBySys(AirLoopNum);
    2036          929 :             pzSumBySys = 0.0;
    2037          929 :             state.dataSize->PsBySys(AirLoopNum) = 0.0;
    2038         3857 :             for (int zoneNumOnLoop = 1; zoneNumOnLoop <= state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones; ++zoneNumOnLoop) {
    2039         2928 :                 int zoneNum = state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).ActualZoneNumber(zoneNumOnLoop);
    2040         2928 :                 auto const &finalZoneSizing = state.dataSize->FinalZoneSizing(zoneNum);
    2041        94823 :                 for (int PeopleNum = 1; PeopleNum <= state.dataHeatBal->TotPeople; ++PeopleNum) {
    2042        91895 :                     if (state.dataHeatBal->People(PeopleNum).ZonePtr == finalZoneSizing.ZoneNum) {
    2043         2824 :                         pzSumBySys +=
    2044         2824 :                             (state.dataHeatBal->People(PeopleNum).NumberOfPeople * state.dataHeatBal->Zone(finalZoneSizing.ZoneNum).Multiplier *
    2045         2824 :                              state.dataHeatBal->Zone(finalZoneSizing.ZoneNum).ListMultiplier);
    2046              :                     }
    2047              :                 }
    2048              :             }
    2049              :         }
    2050              :     }
    2051              : 
    2052          347 :     if (!anyVRPinModel) {
    2053         1299 :         for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
    2054          959 :             state.dataSize->DBySys(AirLoopNum) = 1.0;
    2055              :         }
    2056          340 :         return; // early return to not march through schedules
    2057              :     }
    2058              : 
    2059            7 :     DisplayString(state, "Standard 62.1 Ventilation Rate Procedure: Determine System Occupant Diversity");
    2060              :     // now march through all zone timesteps for entire year to find the concurrent max
    2061            7 :     int DaysInYear(366);  // assume leap year
    2062            7 :     int dayOfWeekType(1); // assume year starts on Sunday
    2063            7 :     Weather::CalcSpecialDayTypes(state);
    2064         2569 :     for (int DayLoop = 1; DayLoop <= DaysInYear; ++DayLoop) { // loop over all days in year
    2065         2562 :         state.dataEnvrn->HolidayIndex = state.dataWeather->SpecialDayTypes(DayLoop);
    2066         2562 :         state.dataEnvrn->DayOfYear_Schedule = DayLoop;
    2067         2562 :         state.dataEnvrn->DayOfWeek = dayOfWeekType;
    2068         2562 :         ++dayOfWeekType;
    2069         2562 :         if (dayOfWeekType > 7) {
    2070          364 :             dayOfWeekType = 1;
    2071              :         }
    2072        64050 :         for (int hrOfDay = 1; hrOfDay <= Constant::iHoursInDay; ++hrOfDay) {  // loop over all hours in day
    2073        61488 :             state.dataGlobal->HourOfDay = hrOfDay;                            // avoid crash in schedule manager
    2074       325008 :             for (int TS = 1; TS <= state.dataGlobal->TimeStepsInHour; ++TS) { // loop over all timesteps in hour
    2075       263520 :                 state.dataGlobal->TimeStep = TS;                              // avoid crash in schedule manager
    2076       263520 :                 Real64 TSfraction(0.0);
    2077       263520 :                 if (state.dataGlobal->TimeStepsInHour > 0.0) {
    2078       263520 :                     TSfraction = 1.0 / double(state.dataGlobal->TimeStepsInHour);
    2079              :                 }
    2080       667584 :                 for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) { // loop over all the air systems
    2081       404064 :                     auto const &finalSysSizing = state.dataSize->FinalSysSizing(AirLoopNum);
    2082              :                     int SysSizNum =
    2083       404064 :                         Util::FindItemInList(finalSysSizing.AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
    2084       404064 :                     if (SysSizNum == 0) {
    2085            0 :                         SysSizNum = 1; // use first when none applicable
    2086              :                     }
    2087       404064 :                     if (finalSysSizing.OAAutoSized && state.dataSize->SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
    2088              : 
    2089              :                         // Loop over all zones connected to air loop
    2090       333792 :                         Real64 TotConcurrentPeopleOnSys = 0.0;
    2091      1932480 :                         for (int zoneNumOnLoop = 1; zoneNumOnLoop <= state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones; ++zoneNumOnLoop) {
    2092      1598688 :                             int CtrlZoneNum = state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).ActualZoneNumber(zoneNumOnLoop);
    2093              : 
    2094     17497728 :                             for (int PeopleNum = 1; PeopleNum <= state.dataHeatBal->TotPeople; ++PeopleNum) {
    2095     15899040 :                                 if (state.dataHeatBal->People(PeopleNum).ZonePtr == state.dataSize->FinalZoneSizing(CtrlZoneNum).ZoneNum) {
    2096              :                                     Real64 PeopleInZone =
    2097      1598688 :                                         (state.dataHeatBal->People(PeopleNum).NumberOfPeople *
    2098      1598688 :                                          state.dataHeatBal->Zone(state.dataSize->FinalZoneSizing(CtrlZoneNum).ZoneNum).Multiplier *
    2099      1598688 :                                          state.dataHeatBal->Zone(state.dataSize->FinalZoneSizing(CtrlZoneNum).ZoneNum).ListMultiplier);
    2100      1598688 :                                     Real64 schMultiplier = state.dataHeatBal->People(PeopleNum).sched->getHrTsVal(state, hrOfDay, TS);
    2101      1598688 :                                     PeopleInZone = PeopleInZone * schMultiplier;
    2102      1598688 :                                     TotConcurrentPeopleOnSys += PeopleInZone;
    2103              :                                 }
    2104              :                             }
    2105              :                         }
    2106       333792 :                         if (TotConcurrentPeopleOnSys >= state.dataSize->PsBySys(AirLoopNum)) {
    2107        76084 :                             state.dataSize->PsBySys(AirLoopNum) = TotConcurrentPeopleOnSys; // store max concurrent occupancy on system
    2108              :                             // store timing description of Last occurrence of max
    2109        76084 :                             int Month(0);
    2110        76084 :                             int DayOfMonth(0);
    2111        76084 :                             General::InvOrdinalDay(DayLoop, Month, DayOfMonth, 1);
    2112        76084 :                             Real64 TimeHrsFraction = (double(hrOfDay) - 1.0) + double(TS) * TSfraction;
    2113        76084 :                             int TimeHrsInt = int(TimeHrsFraction);
    2114        76084 :                             int TimeMinsInt = nint((TimeHrsFraction - TimeHrsInt) * 60.0);
    2115        76084 :                             if (TimeMinsInt == 60) {
    2116            0 :                                 ++TimeHrsInt;
    2117            0 :                                 TimeMinsInt = 0;
    2118              :                             }
    2119        76084 :                             state.dataSize->PeakPsOccurrenceDateTimeStringBySys(AirLoopNum) =
    2120       152168 :                                 format("{:02}/{:02} {:02}:{:02}", Month, DayOfMonth, TimeHrsInt, TimeMinsInt);
    2121        76084 :                             state.dataSize->PeakPsOccurrenceEnvironmentStringBySys(AirLoopNum) = "Full Year Schedule";
    2122              :                         }
    2123              :                     } // if autosized and VRP
    2124              :                 } // air loops
    2125              :             }
    2126              :         }
    2127              :     }
    2128              : 
    2129              :     // compute D for standard 62.1 by system
    2130           17 :     for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
    2131           10 :         auto const &finalSysSizing = state.dataSize->FinalSysSizing(AirLoopNum);
    2132           10 :         int SysSizNum = Util::FindItemInList(finalSysSizing.AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
    2133           10 :         if (SysSizNum == 0) {
    2134            0 :             SysSizNum = 1; // use first when none applicable
    2135              :         }
    2136              : 
    2137              :         // compute D if set to autosize
    2138           10 :         if (state.dataSize->SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
    2139            8 :             if (state.dataSize->PzSumBySys(AirLoopNum) > 0.0) {
    2140            8 :                 state.dataSize->DBySys(AirLoopNum) = state.dataSize->PsBySys(AirLoopNum) / state.dataSize->PzSumBySys(AirLoopNum);
    2141              :             } else {
    2142            0 :                 state.dataSize->DBySys(AirLoopNum) = 1.0;
    2143              :             }
    2144            8 :             state.dataSize->DBySys(AirLoopNum) = min(1.0, state.dataSize->DBySys(AirLoopNum));
    2145              :         } else {
    2146              :             // set the occupant diversity based on user-specified value
    2147            2 :             state.dataSize->DBySys(AirLoopNum) = state.dataSize->SysSizInput(SysSizNum).OccupantDiversity;
    2148              :         }
    2149              : 
    2150              :         // For single zone systems, D should be 1.0.
    2151           10 :         if (state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones == 1) {
    2152            0 :             state.dataSize->DBySys(AirLoopNum) = 1.0;
    2153            0 :             ShowWarningError(
    2154              :                 state,
    2155            0 :                 format("The {} air loop serves a single zone. The Occupant Diversity was calculated or set to a value less than 1.0. Single-zone air "
    2156              :                        "loops should have an Occupant Diversity of 1.0. The Occupant Diversity value for that air loop has been reset to 1.0",
    2157            0 :                        finalSysSizing.AirPriLoopName));
    2158              :         }
    2159              :     }
    2160              : }
    2161              : 
    2162          801 : void GetOARequirements(EnergyPlusData &state)
    2163              : {
    2164              : 
    2165              :     // SUBROUTINE INFORMATION:
    2166              :     //       AUTHOR         R. Raustad - FSEC
    2167              :     //       DATE WRITTEN   February 2010
    2168              : 
    2169              :     // PURPOSE OF THIS SUBROUTINE:
    2170              :     // Obtains input data for the OA Requirements object and stores it in
    2171              :     // appropriate data structure.
    2172              : 
    2173              :     // METHODOLOGY EMPLOYED:
    2174              :     // Uses InputProcessor "Get" routines to obtain data.
    2175              :     // This object requires only a name where the default values are assumed
    2176              :     // if subsequent fields are not entered.
    2177              : 
    2178              :     static constexpr std::string_view RoutineName("GetOARequirements: "); // include trailing blank space
    2179              : 
    2180              :     int NumAlphas;  // Number of Alphas for each GetObjectItem call
    2181              :     int NumNumbers; // Number of Numbers for each GetObjectItem call
    2182              :     int TotalArgs;  // Total number of alpha and numeric arguments (max) for a
    2183              : 
    2184          801 :     std::string CurrentModuleObject; // for ease in getting objects
    2185          801 :     Array1D_string Alphas;           // Alpha input items for object
    2186          801 :     Array1D_string cAlphaFields;     // Alpha field names
    2187          801 :     Array1D_string cNumericFields;   // Numeric field names
    2188          801 :     Array1D<Real64> Numbers;         // Numeric input items for object
    2189          801 :     Array1D_bool lAlphaBlanks;       // Logical array, alpha field input BLANK = .TRUE.
    2190          801 :     Array1D_bool lNumericBlanks;     // Logical array, numeric field input BLANK = .TRUE.
    2191              : 
    2192          801 :     CurrentModuleObject = "DesignSpecification:OutdoorAir";
    2193          801 :     int numOARequirements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
    2194          801 :     state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, TotalArgs, NumAlphas, NumNumbers);
    2195          801 :     std::string cCurrentModuleObject2 = "DesignSpecification:OutdoorAir:SpaceList";
    2196          801 :     int numOARequirementsLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject2);
    2197          801 :     state.dataSize->NumOARequirements = numOARequirements + numOARequirementsLists;
    2198              : 
    2199          801 :     Alphas.allocate(NumAlphas);
    2200          801 :     cAlphaFields.allocate(NumAlphas);
    2201          801 :     cNumericFields.allocate(NumNumbers);
    2202          801 :     Numbers.dimension(NumNumbers, 0.0);
    2203          801 :     lAlphaBlanks.dimension(NumAlphas, true);
    2204          801 :     lNumericBlanks.dimension(NumNumbers, true);
    2205              : 
    2206          801 :     if (state.dataSize->NumOARequirements > 0) {
    2207              :         int IOStatus;            // Used in GetObjectItem
    2208          439 :         bool ErrorsFound(false); // If errors detected in input
    2209          439 :         state.dataSize->OARequirements.allocate(state.dataSize->NumOARequirements);
    2210              : 
    2211              :         // Start Loading the System Input
    2212         4693 :         for (int OAIndex = 1; OAIndex <= numOARequirements; ++OAIndex) {
    2213              : 
    2214         4254 :             state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2215              :                                                                      CurrentModuleObject,
    2216              :                                                                      OAIndex,
    2217              :                                                                      Alphas,
    2218              :                                                                      NumAlphas,
    2219              :                                                                      Numbers,
    2220              :                                                                      NumNumbers,
    2221              :                                                                      IOStatus,
    2222              :                                                                      lNumericBlanks,
    2223              :                                                                      lAlphaBlanks,
    2224              :                                                                      cAlphaFields,
    2225              :                                                                      cNumericFields);
    2226         4254 :             Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound);
    2227              : 
    2228         4254 :             state.dataSize->OARequirements(OAIndex).Name = Alphas(1);
    2229              : 
    2230         4254 :             ProcessInputOARequirements(
    2231              :                 state, CurrentModuleObject, OAIndex, Alphas, NumAlphas, Numbers, NumNumbers, lAlphaBlanks, cAlphaFields, ErrorsFound);
    2232              :         }
    2233              : 
    2234          439 :         Alphas.deallocate();
    2235          439 :         cAlphaFields.deallocate();
    2236          439 :         cNumericFields.deallocate();
    2237          439 :         Numbers.deallocate();
    2238          439 :         lAlphaBlanks.deallocate();
    2239          439 :         lNumericBlanks.deallocate();
    2240              : 
    2241              :         // DesignSpecification:OutdoorAir:SpaceList
    2242          439 :         auto &ip = state.dataInputProcessing->inputProcessor;
    2243          439 :         auto const instances = ip->epJSON.find(cCurrentModuleObject2);
    2244          439 :         if (instances != ip->epJSON.end()) {
    2245            3 :             auto const &objectSchemaProps = ip->getObjectSchemaProps(state, cCurrentModuleObject2);
    2246            3 :             auto &instancesValue = instances.value();
    2247            3 :             int oaIndex = numOARequirements; // add lists to the end of the same array
    2248              : 
    2249            6 :             for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
    2250            3 :                 ++oaIndex;
    2251            3 :                 auto const &objectFields = instance.value();
    2252            3 :                 auto &thisOAReq = state.dataSize->OARequirements(oaIndex);
    2253            3 :                 ip->markObjectAsUsed(cCurrentModuleObject2, instance.key());
    2254            3 :                 std::string thisOAReqName = Util::makeUPPER(instance.key());
    2255              : 
    2256            3 :                 if (Util::FindItemInList(thisOAReqName, state.dataSize->OARequirements) > 0) {
    2257            0 :                     ShowSevereError(
    2258              :                         state,
    2259            0 :                         format("{}{}=\"{}\" is a duplicate DesignSpecification:OutdoorAir name.", RoutineName, cCurrentModuleObject2, thisOAReqName));
    2260            0 :                     ErrorsFound = true;
    2261              :                 }
    2262            3 :                 thisOAReq.Name = thisOAReqName;
    2263              : 
    2264              :                 // List of spaces and DSOA names
    2265            3 :                 thisOAReq.numDSOA = 0;
    2266            3 :                 auto extensibles = objectFields.find("space_specs");
    2267            3 :                 auto const &extensionSchemaProps = objectSchemaProps["space_specs"]["items"]["properties"];
    2268            3 :                 if (extensibles != objectFields.end()) {
    2269            3 :                     auto &extensiblesArray = extensibles.value();
    2270            9 :                     for (auto &extensibleInstance : extensiblesArray) {
    2271              :                         // Zones and spaces are not created yet, validate space names in ZoneEquipmentManager::SetupZoneSizingArrays
    2272           12 :                         std::string thisSpaceName = ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "space_name");
    2273            6 :                         thisOAReq.dsoaSpaceNames.emplace_back(thisSpaceName);
    2274              :                         std::string thisDsoaName =
    2275           12 :                             ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "space_design_specification_outdoor_air_object_name");
    2276            6 :                         int thisDsoaNum = Util::FindItemInList(thisDsoaName, state.dataSize->OARequirements, oaIndex);
    2277            6 :                         if (thisDsoaNum > 0) {
    2278            6 :                             thisOAReq.dsoaIndexes.emplace_back(thisDsoaNum);
    2279            6 :                             ++thisOAReq.numDSOA;
    2280              :                         } else {
    2281            0 :                             ShowSevereError(state, format("{}{}={}", RoutineName, cCurrentModuleObject2, thisOAReq.Name));
    2282            0 :                             ShowContinueError(state, format("DesignSpecification:OutdoorAir={} not found.", thisDsoaName));
    2283            0 :                             ErrorsFound = true;
    2284              :                         }
    2285            9 :                     }
    2286              :                 } else {
    2287            0 :                     ShowSevereError(state, format("{}{}={} is empty.", RoutineName, cCurrentModuleObject2, thisOAReq.Name));
    2288            0 :                     ShowContinueError(state, "At least one pair of Space Name and Space Design Specification Outdoor Air Object Name is required.");
    2289            0 :                     ErrorsFound = true;
    2290              :                 }
    2291            6 :             }
    2292              : 
    2293            3 :             if (ErrorsFound) {
    2294            0 :                 ShowFatalError(state, format("{}Errors found in input.  Preceding condition(s) cause termination.", RoutineName));
    2295              :             }
    2296              :         }
    2297          439 :     }
    2298          801 : }
    2299              : 
    2300         4254 : void ProcessInputOARequirements(EnergyPlusData &state,
    2301              :                                 std::string const &CurrentModuleObject,
    2302              :                                 int const OAIndex,
    2303              :                                 Array1D_string const &Alphas,
    2304              :                                 int const NumAlphas,
    2305              :                                 Array1D<Real64> const &Numbers,
    2306              :                                 int const NumNumbers,
    2307              :                                 Array1D_bool const &lAlphaBlanks,
    2308              :                                 Array1D_string const &cAlphaFields,
    2309              :                                 bool &ErrorsFound // If errors found in input
    2310              : )
    2311              : {
    2312              : 
    2313              :     // SUBROUTINE INFORMATION:
    2314              :     //       AUTHOR         R. Raustad - FSEC
    2315              :     //       DATE WRITTEN   February 2010
    2316              : 
    2317              :     // PURPOSE OF THIS SUBROUTINE:
    2318              :     // Obtains input data for the OA Requirements object and stores it in
    2319              :     // appropriate data structure.
    2320              : 
    2321              :     // METHODOLOGY EMPLOYED:
    2322              :     // Uses InputProcessor "Get" routines to obtain data.
    2323              :     // This object requires only a name where the default values are assumed
    2324              :     // if subsequent fields are not entered.
    2325              : 
    2326              :     static constexpr std::string_view RoutineName("GetOARequirements: "); // include trailing blank space
    2327              :     static constexpr std::string_view routineName = "GetOARequirements";
    2328              : 
    2329         4254 :     ErrorObjectHeader eoh{routineName, CurrentModuleObject, Alphas(1)};
    2330              : 
    2331         4254 :     auto &thisOARequirements(state.dataSize->OARequirements(OAIndex));
    2332              : 
    2333         4254 :     if (NumAlphas > 1) {
    2334         4254 :         thisOARequirements.OAFlowMethod = static_cast<OAFlowCalcMethod>(getEnumValue(OAFlowCalcMethodNamesUC, Util::makeUPPER(Alphas(2))));
    2335         4254 :         if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Invalid) {
    2336            0 :             ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, CurrentModuleObject, state.dataSize->OARequirements(OAIndex).Name));
    2337            0 :             ShowContinueError(state, format("...Invalid {}=\"{}\",", cAlphaFields(2), Alphas(2)));
    2338            0 :             ShowContinueError(state,
    2339              :                               "...Valid choices are Flow/Person, Flow/Zone, Flow/Area, AirChanges/Hour, Sum, Maximum, IndoorAirQualityProcedure, "
    2340              :                               "ProportionalControlBasedOnDesignOccupancy, and ProportionalControlBasedOnOccupancySchedule.");
    2341            0 :             ErrorsFound = true;
    2342              :         }
    2343              :     } else {
    2344              :         // default value for Outdoor Air Method
    2345            0 :         thisOARequirements.OAFlowMethod = OAFlowCalcMethod::PerPerson;
    2346              :     }
    2347         4254 :     if (NumNumbers > 0) {
    2348         4253 :         state.dataSize->OARequirements(OAIndex).OAFlowPerPerson = Numbers(1);
    2349              :     } else {
    2350              :         // default value for Outdoor Air Flow per Person when per person flow is counted
    2351            1 :         state.dataSize->OARequirements(OAIndex).OAFlowPerPerson = 0.00944;
    2352              :     }
    2353              :     // if one of the methods that should not use the flow per person field is chosen then zero out the flow per person to avoid it
    2354              :     // being counted later #4378
    2355         4254 :     if (thisOARequirements.OAFlowMethod != OAFlowCalcMethod::PerPerson && thisOARequirements.OAFlowMethod != OAFlowCalcMethod::Sum &&
    2356         1939 :         thisOARequirements.OAFlowMethod != OAFlowCalcMethod::Max && thisOARequirements.OAFlowMethod != OAFlowCalcMethod::PCOccSch &&
    2357         1932 :         thisOARequirements.OAFlowMethod != OAFlowCalcMethod::PCDesOcc && thisOARequirements.OAFlowMethod != OAFlowCalcMethod::IAQProcedure) {
    2358         1924 :         state.dataSize->OARequirements(OAIndex).OAFlowPerPerson = 0.0;
    2359              :     }
    2360              :     // remaining fields default to 0
    2361         4254 :     if (NumNumbers > 1) {
    2362         3934 :         if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::PerArea || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Sum ||
    2363         2532 :             thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Max) {
    2364         1407 :             state.dataSize->OARequirements(OAIndex).OAFlowPerArea = Numbers(2);
    2365         2527 :         } else if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::PCOccSch || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::PCDesOcc ||
    2366         2522 :                    thisOARequirements.OAFlowMethod == OAFlowCalcMethod::IAQProcedure) {
    2367           10 :             state.dataSize->OARequirements(OAIndex).OAFlowPerArea = Numbers(2);
    2368              :         } else {
    2369         2517 :             state.dataSize->OARequirements(OAIndex).OAFlowPerArea = 0.0;
    2370              :         }
    2371              :     }
    2372         4254 :     if (NumNumbers > 2) {
    2373         3383 :         if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::PerZone || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Sum ||
    2374         1789 :             thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Max || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::IAQProcedure) {
    2375         1604 :             state.dataSize->OARequirements(OAIndex).OAFlowPerZone = Numbers(3);
    2376              :         } else {
    2377         1779 :             state.dataSize->OARequirements(OAIndex).OAFlowPerZone = 0.0;
    2378              :         }
    2379              :     }
    2380              : 
    2381         4254 :     if (NumNumbers > 3) {
    2382          422 :         if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::ACH || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Sum ||
    2383          271 :             thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Max || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::IAQProcedure) {
    2384          151 :             state.dataSize->OARequirements(OAIndex).OAFlowACH = Numbers(4);
    2385              :         } else {
    2386          271 :             state.dataSize->OARequirements(OAIndex).OAFlowACH = 0.0;
    2387              :         }
    2388              :     }
    2389              : 
    2390              :     // Set default schedule
    2391         4254 :     if (NumAlphas <= 2 || lAlphaBlanks(3)) {
    2392         4232 :         state.dataSize->OARequirements(OAIndex).oaFlowFracSched = Sched::GetScheduleAlwaysOn(state); // Defaults to constant-1.0
    2393           22 :     } else if ((state.dataSize->OARequirements(OAIndex).oaFlowFracSched = Sched::GetSchedule(state, Alphas(3))) == nullptr) {
    2394            0 :         ShowSevereItemNotFound(state, eoh, cAlphaFields(3), Alphas(3));
    2395            0 :         ErrorsFound = true;
    2396           22 :     } else if (!state.dataSize->OARequirements(OAIndex).oaFlowFracSched->checkMinMaxVals(state, Clusive::In, 0.0, Clusive::In, 1.0)) {
    2397            0 :         Sched::ShowSevereBadMinMax(state, eoh, cAlphaFields(3), Alphas(3), Clusive::In, 0.0, Clusive::In, 1.0);
    2398            0 :         ErrorsFound = true;
    2399              :     }
    2400              : 
    2401         4254 :     if (NumAlphas <= 3 || lAlphaBlanks(4)) {
    2402            2 :     } else if ((state.dataSize->OARequirements(OAIndex).oaPropCtlMinRateSched = Sched::GetSchedule(state, Alphas(4))) == nullptr) {
    2403            0 :         ShowSevereItemNotFound(state, eoh, cAlphaFields(4), Alphas(4));
    2404            0 :         ErrorsFound = true;
    2405            2 :     } else if (!state.dataSize->OARequirements(OAIndex).oaPropCtlMinRateSched->checkMinMaxVals(state, Clusive::In, 0.0, Clusive::In, 1.0)) {
    2406            0 :         Sched::ShowSevereBadMinMax(state, eoh, cAlphaFields(4), Alphas(4), Clusive::In, 0.0, Clusive::In, 1.0);
    2407            0 :         ErrorsFound = true;
    2408              :     }
    2409         4254 : }
    2410              : 
    2411          801 : void GetZoneAirDistribution(EnergyPlusData &state)
    2412              : {
    2413              : 
    2414              :     // SUBROUTINE INFORMATION:
    2415              :     //       AUTHOR         T. Hong - LBNL
    2416              :     //       DATE WRITTEN   March 2012
    2417              : 
    2418              :     // PURPOSE OF THIS SUBROUTINE:
    2419              :     // Obtains input data for the zone air distribution objects and stores it in
    2420              :     // appropriate data structure.
    2421              : 
    2422              :     // METHODOLOGY EMPLOYED:
    2423              :     // Uses InputProcessor "Get" routines to obtain data.
    2424              :     // This object requires only a name where the default values are assumed
    2425              :     // if subsequent fields are not entered.
    2426              : 
    2427              :     // SUBROUTINE PARAMETER DEFINITIONS:
    2428              :     static constexpr std::string_view RoutineName("GetZoneAirDistribution: "); // include trailing blank space
    2429              :     static constexpr std::string_view routineName = "GetZoneAirDistribution";  // include trailing blank space
    2430              : 
    2431              :     // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    2432              :     int NumAlphas;  // Number of Alphas for each GetObjectItem call
    2433              :     int NumNumbers; // Number of Numbers for each GetObjectItem call
    2434              :     int TotalArgs;  // Total number of alpha and numeric arguments (max) for a
    2435              : 
    2436          801 :     std::string CurrentModuleObject; // for ease in getting objects
    2437          801 :     Array1D_string Alphas;           // Alpha input items for object
    2438          801 :     Array1D_string cAlphaFields;     // Alpha field names
    2439          801 :     Array1D_string cNumericFields;   // Numeric field names
    2440          801 :     Array1D<Real64> Numbers;         // Numeric input items for object
    2441          801 :     Array1D_bool lAlphaBlanks;       // Logical array, alpha field input BLANK = .TRUE.
    2442          801 :     Array1D_bool lNumericBlanks;     // Logical array, numeric field input BLANK = .TRUE.
    2443              : 
    2444          801 :     CurrentModuleObject = "DesignSpecification:ZoneAirDistribution";
    2445          801 :     state.dataSize->NumZoneAirDistribution = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
    2446          801 :     state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, TotalArgs, NumAlphas, NumNumbers);
    2447              : 
    2448          801 :     Alphas.allocate(NumAlphas);
    2449          801 :     cAlphaFields.allocate(NumAlphas);
    2450          801 :     cNumericFields.allocate(NumNumbers);
    2451          801 :     Numbers.dimension(NumNumbers, 0.0);
    2452          801 :     lAlphaBlanks.dimension(NumAlphas, true);
    2453          801 :     lNumericBlanks.dimension(NumNumbers, true);
    2454              : 
    2455          801 :     if (state.dataSize->NumZoneAirDistribution > 0) {
    2456              :         int IOStatus;            // Used in GetObjectItem
    2457           87 :         bool ErrorsFound(false); // If errors detected in input
    2458           87 :         state.dataSize->ZoneAirDistribution.allocate(state.dataSize->NumZoneAirDistribution);
    2459              : 
    2460              :         // Start Loading the zone air distribution input
    2461          623 :         for (int ZADIndex = 1; ZADIndex <= state.dataSize->NumZoneAirDistribution; ++ZADIndex) {
    2462              : 
    2463          536 :             state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2464              :                                                                      CurrentModuleObject,
    2465              :                                                                      ZADIndex,
    2466              :                                                                      Alphas,
    2467              :                                                                      NumAlphas,
    2468              :                                                                      Numbers,
    2469              :                                                                      NumNumbers,
    2470              :                                                                      IOStatus,
    2471              :                                                                      lNumericBlanks,
    2472              :                                                                      lAlphaBlanks,
    2473              :                                                                      cAlphaFields,
    2474              :                                                                      cNumericFields);
    2475              : 
    2476          536 :             ErrorObjectHeader eoh{routineName, CurrentModuleObject, Alphas(1)};
    2477          536 :             Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound);
    2478              : 
    2479          536 :             state.dataSize->ZoneAirDistribution(ZADIndex).Name = Alphas(1);
    2480              : 
    2481              :             // Zone Air Distribution Effectiveness in Cooling Mode
    2482          536 :             if (NumNumbers > 0) {
    2483          536 :                 state.dataSize->ZoneAirDistribution(ZADIndex).ZoneADEffCooling = Numbers(1);
    2484              :             } else {
    2485              :                 // default value
    2486            0 :                 state.dataSize->ZoneAirDistribution(ZADIndex).ZoneADEffCooling = 1.0;
    2487              :             }
    2488              : 
    2489              :             // Zone Air Distribution Effectiveness in Heating Mode
    2490          536 :             if (NumNumbers > 1) {
    2491          536 :                 state.dataSize->ZoneAirDistribution(ZADIndex).ZoneADEffHeating = Numbers(2);
    2492              :             } else {
    2493              :                 // default value
    2494            0 :                 state.dataSize->ZoneAirDistribution(ZADIndex).ZoneADEffHeating = 1.0;
    2495              :             }
    2496              : 
    2497              :             // Zone Secondary Recirculation Fraction
    2498          536 :             if (NumNumbers > 2) {
    2499           25 :                 state.dataSize->ZoneAirDistribution(ZADIndex).ZoneSecondaryRecirculation = Numbers(3);
    2500              :             } else {
    2501              :                 // default value
    2502          511 :                 state.dataSize->ZoneAirDistribution(ZADIndex).ZoneSecondaryRecirculation = 0.0;
    2503              :             }
    2504              : 
    2505              :             // Zone Ventilation Efficiency
    2506          536 :             if (NumNumbers > 3) {
    2507           11 :                 state.dataSize->ZoneAirDistribution(ZADIndex).ZoneVentilationEff = Numbers(4);
    2508              :             } else {
    2509              :                 // default value
    2510          525 :                 state.dataSize->ZoneAirDistribution(ZADIndex).ZoneVentilationEff = 0.0;
    2511              :             }
    2512              : 
    2513          536 :             if (NumAlphas <= 1 || lAlphaBlanks(2)) {
    2514            6 :             } else if ((state.dataSize->ZoneAirDistribution(ZADIndex).zoneADEffSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) {
    2515            0 :                 ShowSevereItemNotFound(state, eoh, cAlphaFields(2), Alphas(2));
    2516            0 :                 ErrorsFound = true;
    2517            6 :             } else if (!state.dataSize->ZoneAirDistribution(ZADIndex).zoneADEffSched->checkMinVal(state, Clusive::Ex, 0.0)) {
    2518            0 :                 Sched::ShowSevereBadMin(state, eoh, cAlphaFields(2), Alphas(2), Clusive::Ex, 0.0);
    2519            0 :                 ErrorsFound = true;
    2520              :             }
    2521              :         }
    2522              : 
    2523           87 :         Alphas.deallocate();
    2524           87 :         cAlphaFields.deallocate();
    2525           87 :         cNumericFields.deallocate();
    2526           87 :         Numbers.deallocate();
    2527           87 :         lAlphaBlanks.deallocate();
    2528           87 :         lNumericBlanks.deallocate();
    2529              : 
    2530           87 :         if (ErrorsFound) {
    2531            0 :             ShowFatalError(state, format("{}Errors found in input.  Preceding condition(s) cause termination.", RoutineName));
    2532              :         }
    2533              :     }
    2534          801 : }
    2535              : 
    2536          801 : void GetSizingParams(EnergyPlusData &state)
    2537              : {
    2538              : 
    2539              :     // SUBROUTINE INFORMATION:
    2540              :     //       AUTHOR         Fred Buhl
    2541              :     //       DATE WRITTEN   January 2002
    2542              : 
    2543              :     // PURPOSE OF THIS SUBROUTINE:
    2544              :     // Obtains input data for the Sizing Parameters object and stores it in
    2545              :     // appropriate data structure.
    2546              : 
    2547              :     // METHODOLOGY EMPLOYED:
    2548              :     // Uses InputProcessor "Get" routines to obtain data.
    2549              : 
    2550              :     // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    2551              :     int NumAlphas;  // Number of Alphas for each GetObjectItem call
    2552              :     int NumNumbers; // Number of Numbers for each GetObjectItem call
    2553              :     int IOStatus;   // Used in GetObjectItem
    2554              : 
    2555          801 :     auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
    2556          801 :     cCurrentModuleObject = "Sizing:Parameters";
    2557          801 :     int NumSizParams = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    2558              : 
    2559          801 :     if (NumSizParams == 1) {
    2560          744 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2561              :                                                                  cCurrentModuleObject,
    2562              :                                                                  1,
    2563          372 :                                                                  state.dataIPShortCut->cAlphaArgs,
    2564              :                                                                  NumAlphas,
    2565          372 :                                                                  state.dataIPShortCut->rNumericArgs,
    2566              :                                                                  NumNumbers,
    2567              :                                                                  IOStatus,
    2568          372 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    2569          372 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    2570          372 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    2571          372 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    2572          372 :         if (state.dataIPShortCut->lNumericFieldBlanks(1) || state.dataIPShortCut->rNumericArgs(1) < 0.0) {
    2573            0 :             state.dataSize->GlobalHeatSizingFactor = 1.0;
    2574              :         } else {
    2575          372 :             state.dataSize->GlobalHeatSizingFactor = state.dataIPShortCut->rNumericArgs(1);
    2576              :         }
    2577          372 :         if (state.dataIPShortCut->lNumericFieldBlanks(2) || state.dataIPShortCut->rNumericArgs(2) < 0.0) {
    2578            0 :             state.dataSize->GlobalCoolSizingFactor = 1.0;
    2579              :         } else {
    2580          372 :             state.dataSize->GlobalCoolSizingFactor = state.dataIPShortCut->rNumericArgs(2);
    2581              :         }
    2582          372 :         if (state.dataIPShortCut->lNumericFieldBlanks(3) || state.dataIPShortCut->rNumericArgs(3) <= 0.0) {
    2583          289 :             state.dataSize->NumTimeStepsInAvg = state.dataGlobal->TimeStepsInHour;
    2584              :         } else {
    2585           83 :             state.dataSize->NumTimeStepsInAvg = int(state.dataIPShortCut->rNumericArgs(3));
    2586              :         }
    2587          429 :     } else if (NumSizParams == 0) {
    2588          429 :         state.dataSize->GlobalHeatSizingFactor = 1.0;
    2589          429 :         state.dataSize->GlobalCoolSizingFactor = 1.0;
    2590          429 :         state.dataSize->NumTimeStepsInAvg = state.dataGlobal->TimeStepsInHour;
    2591              :     } else {
    2592            0 :         ShowFatalError(state, format("{}: More than 1 occurrence of this object; only 1 allowed", cCurrentModuleObject));
    2593              :     }
    2594          801 :     if (state.dataGlobal->OverrideTimestep) {
    2595            1 :         state.dataSize->NumTimeStepsInAvg = state.dataGlobal->TimeStepsInHour;
    2596            3 :         ShowWarningError(state,
    2597              :                          "Due to the use of the fast simulation mode, the time step for simulation and averaging window of sizing is overwritten to "
    2598              :                          "one hour. Original user inputs for averaging window and timestep are no longer used.");
    2599              :     }
    2600          801 :     if (state.dataSize->NumTimeStepsInAvg < state.dataGlobal->TimeStepsInHour) {
    2601            0 :         ShowWarningError(state,
    2602            0 :                          format("{}: note {} entered value=[{}] is less than 1 hour (i.e., {} timesteps).",
    2603              :                                 cCurrentModuleObject,
    2604            0 :                                 state.dataIPShortCut->cNumericFieldNames(3),
    2605            0 :                                 state.dataSize->NumTimeStepsInAvg,
    2606            0 :                                 state.dataGlobal->TimeStepsInHour));
    2607              :     }
    2608              : 
    2609          801 :     cCurrentModuleObject = "OutputControl:Sizing:Style";
    2610          801 :     int Temp = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    2611              : 
    2612          801 :     if (Temp == 0) {
    2613          800 :         state.dataIPShortCut->cAlphaArgs(1) = "Comma";
    2614          800 :         state.dataSize->SizingFileColSep = CharComma; // comma
    2615            1 :     } else if (Temp == 1) {
    2616            2 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2617              :                                                                  cCurrentModuleObject,
    2618              :                                                                  1,
    2619            1 :                                                                  state.dataIPShortCut->cAlphaArgs,
    2620              :                                                                  NumAlphas,
    2621            1 :                                                                  state.dataIPShortCut->rNumericArgs,
    2622              :                                                                  NumNumbers,
    2623              :                                                                  IOStatus,
    2624            1 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    2625            1 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    2626            1 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    2627            1 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    2628            1 :         if (state.dataIPShortCut->cAlphaArgs(1) == "COMMA") {
    2629            1 :             state.dataSize->SizingFileColSep = CharComma; // comma
    2630            1 :             state.dataIPShortCut->cAlphaArgs(1) = "Comma";
    2631            0 :         } else if (state.dataIPShortCut->cAlphaArgs(1) == "TAB") {
    2632            0 :             state.dataSize->SizingFileColSep = CharTab; // tab
    2633            0 :             state.dataIPShortCut->cAlphaArgs(1) = "Tab";
    2634            0 :         } else if (state.dataIPShortCut->cAlphaArgs(1) == "FIXED" || state.dataIPShortCut->cAlphaArgs(1) == "SPACE") {
    2635            0 :             state.dataSize->SizingFileColSep = CharSpace; // space
    2636            0 :             state.dataIPShortCut->cAlphaArgs(1) = "Space";
    2637              :         } else {
    2638            0 :             state.dataSize->SizingFileColSep = CharComma; // comma
    2639            0 :             ShowWarningError(state,
    2640            0 :                              format("{}: invalid {} entered value=\"{}\", Commas will be used to separate fields.",
    2641              :                                     cCurrentModuleObject,
    2642            0 :                                     state.dataIPShortCut->cAlphaFieldNames(1),
    2643            0 :                                     state.dataIPShortCut->cAlphaArgs(1)));
    2644            0 :             state.dataIPShortCut->cAlphaArgs(1) = "Comma";
    2645              :         }
    2646            1 :         print(state.files.eio, "! <Sizing Output Files>,Style\n");
    2647            1 :         print(state.files.eio, "Sizing Output Files,{}\n", state.dataIPShortCut->cAlphaArgs(1));
    2648              :     }
    2649          801 : }
    2650              : 
    2651          801 : void GetZoneSizingInput(EnergyPlusData &state)
    2652              : {
    2653              : 
    2654              :     // SUBROUTINE INFORMATION:
    2655              :     //       AUTHOR         Fred Buhl
    2656              :     //       DATE WRITTEN   December 2000
    2657              :     //       MODIFIED       Mangesh Basarkar, 06/2011: Specifying zone outside air based on design specification object
    2658              : 
    2659              :     // PURPOSE OF THIS SUBROUTINE:
    2660              :     // Obtains input data for zone sizing objects and stores it in
    2661              :     // appropriate data structures.
    2662              : 
    2663              :     static constexpr std::string_view routineName = "GetZoneSizingInput";
    2664              : 
    2665              :     // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    2666              :     int NumAlphas;           // Number of Alphas for each GetObjectItem call
    2667              :     int NumNumbers;          // Number of Numbers for each GetObjectItem call
    2668              :     int IOStatus;            // Used in GetObjectItem
    2669          801 :     bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine
    2670              :     int NumSizingZoneStatements;
    2671              :     int Item;
    2672              :     int Item1;
    2673              :     bool errFlag;
    2674          801 :     Array1D_string ZoneNames;
    2675              :     int NumZones;
    2676              :     int NumZoneLists;
    2677              : 
    2678              :     struct GlobalMiscObject
    2679              :     {
    2680              :         // Members
    2681              :         std::string Name;
    2682              :         int ZoneOrZoneListPtr;
    2683              :         int NumOfZones;
    2684              :         int StartPtr;
    2685              :         bool ZoneListActive;
    2686              : 
    2687              :         // Default Constructor
    2688         3700 :         GlobalMiscObject() : ZoneOrZoneListPtr(0), NumOfZones(0), StartPtr(0), ZoneListActive(false)
    2689              :         {
    2690         3700 :         }
    2691              :     };
    2692              : 
    2693              :     // Object Data
    2694          801 :     Array1D<ZoneListData> ZoneListNames;
    2695          801 :     Array1D<GlobalMiscObject> SizingZoneObjects;
    2696          801 :     auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
    2697          801 :     cCurrentModuleObject = "Sizing:Zone";
    2698          801 :     NumSizingZoneStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    2699          801 :     SizingZoneObjects.allocate(NumSizingZoneStatements);
    2700              : 
    2701          801 :     if (NumSizingZoneStatements > 0) {
    2702          442 :         errFlag = false;
    2703          442 :         GetZoneAndZoneListNames(state, errFlag, NumZones, ZoneNames, NumZoneLists, ZoneListNames);
    2704              :     }
    2705              : 
    2706          801 :     cCurrentModuleObject = "Sizing:Zone";
    2707          801 :     state.dataSize->NumZoneSizingInput = 0;
    2708          801 :     errFlag = false;
    2709         4501 :     for (Item = 1; Item <= NumSizingZoneStatements; ++Item) {
    2710         7400 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2711              :                                                                  cCurrentModuleObject,
    2712              :                                                                  Item,
    2713         3700 :                                                                  state.dataIPShortCut->cAlphaArgs,
    2714              :                                                                  NumAlphas,
    2715         3700 :                                                                  state.dataIPShortCut->rNumericArgs,
    2716              :                                                                  NumNumbers,
    2717              :                                                                  IOStatus,
    2718         3700 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    2719         3700 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    2720         3700 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    2721         3700 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    2722         3700 :         Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound);
    2723              : 
    2724         3700 :         SizingZoneObjects(Item).Name = state.dataIPShortCut->cAlphaArgs(1);
    2725              : 
    2726         3700 :         Item1 = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneNames, NumZones);
    2727         3700 :         int ZLItem = 0;
    2728         3700 :         if (Item1 == 0 && NumZoneLists > 0) {
    2729            1 :             ZLItem = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneListNames);
    2730              :         }
    2731         3700 :         if (Item1 > 0) {
    2732         3699 :             SizingZoneObjects(Item).StartPtr = state.dataSize->NumZoneSizingInput + 1;
    2733         3699 :             ++state.dataSize->NumZoneSizingInput;
    2734         3699 :             SizingZoneObjects(Item).NumOfZones = 1;
    2735         3699 :             SizingZoneObjects(Item).ZoneListActive = false;
    2736         3699 :             SizingZoneObjects(Item).ZoneOrZoneListPtr = Item1;
    2737            1 :         } else if (ZLItem > 0) {
    2738            1 :             SizingZoneObjects(Item).StartPtr = state.dataSize->NumZoneSizingInput + 1;
    2739            1 :             state.dataSize->NumZoneSizingInput += ZoneListNames(ZLItem).NumOfZones;
    2740            1 :             SizingZoneObjects(Item).NumOfZones = ZoneListNames(ZLItem).NumOfZones;
    2741            1 :             SizingZoneObjects(Item).ZoneListActive = true;
    2742            1 :             SizingZoneObjects(Item).ZoneOrZoneListPtr = ZLItem;
    2743              :         } else {
    2744            0 :             ShowSevereError(state,
    2745            0 :                             format("{}=\"{}\" invalid {} not found.",
    2746              :                                    cCurrentModuleObject,
    2747            0 :                                    state.dataIPShortCut->cAlphaArgs(1),
    2748            0 :                                    state.dataIPShortCut->cAlphaFieldNames(1)));
    2749            0 :             ErrorsFound = true;
    2750            0 :             errFlag = true;
    2751              :         }
    2752              :     }
    2753              : 
    2754          801 :     if (errFlag) {
    2755            0 :         ShowSevereError(state, format("GetZoneSizingInput: Errors with invalid names in {} objects.", cCurrentModuleObject));
    2756            0 :         ShowContinueError(state, "...These will not be read in.  Other errors may occur.");
    2757            0 :         state.dataSize->NumZoneSizingInput = 0;
    2758              :     }
    2759              : 
    2760          801 :     if (state.dataSize->NumZoneSizingInput > 0) {
    2761          442 :         int NumDesDays = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:DesignDay") +
    2762          442 :                          state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileDays") +
    2763          442 :                          state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileConditionType");
    2764          442 :         if (NumDesDays == 0 && (state.dataGlobal->DoZoneSizing || state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing)) {
    2765            0 :             ShowSevereError(state, "Zone Sizing calculations need SizingPeriod:* input. None found.");
    2766            0 :             ErrorsFound = true;
    2767              :         }
    2768          442 :         state.dataSize->ZoneSizingInput.allocate(state.dataSize->NumZoneSizingInput);
    2769              : 
    2770          442 :         int ZoneSizIndex = 0;
    2771         4142 :         for (Item = 1; Item <= NumSizingZoneStatements; ++Item) {
    2772              : 
    2773         7400 :             state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2774              :                                                                      cCurrentModuleObject,
    2775              :                                                                      Item,
    2776         3700 :                                                                      state.dataIPShortCut->cAlphaArgs,
    2777              :                                                                      NumAlphas,
    2778         3700 :                                                                      state.dataIPShortCut->rNumericArgs,
    2779              :                                                                      NumNumbers,
    2780              :                                                                      IOStatus,
    2781         3700 :                                                                      state.dataIPShortCut->lNumericFieldBlanks,
    2782         3700 :                                                                      state.dataIPShortCut->lAlphaFieldBlanks,
    2783         3700 :                                                                      state.dataIPShortCut->cAlphaFieldNames,
    2784         3700 :                                                                      state.dataIPShortCut->cNumericFieldNames);
    2785              : 
    2786         3700 :             ErrorObjectHeader eoh{routineName, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)};
    2787              : 
    2788         7402 :             for (Item1 = 1; Item1 <= SizingZoneObjects(Item).NumOfZones; ++Item1) {
    2789         3702 :                 ++ZoneSizIndex;
    2790         3702 :                 auto &zoneSizingIndex = state.dataSize->ZoneSizingInput(ZoneSizIndex);
    2791         3702 :                 if (!SizingZoneObjects(Item).ZoneListActive) {
    2792         3699 :                     if (SizingZoneObjects(Item).ZoneOrZoneListPtr > 0) {
    2793         3699 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneName = ZoneNames(SizingZoneObjects(Item).ZoneOrZoneListPtr);
    2794              :                     } else {
    2795              :                         // Invalid zone, will be caught later
    2796            0 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneName = "Invalid Zone Name";
    2797              :                     }
    2798              :                 } else { // Zone list active
    2799            3 :                     if (SizingZoneObjects(Item).ZoneOrZoneListPtr > 0 && ZoneListNames(SizingZoneObjects(Item).ZoneOrZoneListPtr).Zones(Item1) > 0) {
    2800            3 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneName =
    2801            6 :                             ZoneNames(ZoneListNames(SizingZoneObjects(Item).ZoneOrZoneListPtr).Zones(Item1));
    2802              :                     } else {
    2803              :                         // Invalid zone, will be caught later
    2804            0 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneName = "Invalid Zone Name";
    2805              :                     }
    2806              :                 }
    2807         3702 :                 bool const nameEmpty = Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound);
    2808         3702 :                 if (nameEmpty && !SizingZoneObjects(Item).ZoneListActive) {
    2809            0 :                     ShowContinueError(state, "Zone may have been entered in a ZoneList assignment.");
    2810              :                 }
    2811              : 
    2812              :                 //  A2, \field Zone Cooling Design Supply Air Temperature Input Method
    2813              :                 //      \required-field
    2814              :                 //      \type choice
    2815              :                 //      \key SupplyAirTemperature
    2816              :                 //      \key TemperatureDifference
    2817              :                 //      \default SupplyAirTemperature
    2818              :                 {
    2819         3702 :                     std::string const &coolingSATMethod = state.dataIPShortCut->cAlphaArgs(2);
    2820         3702 :                     if (coolingSATMethod == "SUPPLYAIRTEMPERATURE") {
    2821         3647 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnCoolDgnSAMethod = SupplyAirTemperature;
    2822           55 :                     } else if (coolingSATMethod == "TEMPERATUREDIFFERENCE") {
    2823           55 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnCoolDgnSAMethod = TemperatureDifference;
    2824              :                     } else {
    2825            0 :                         ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    2826            0 :                         ShowContinueError(
    2827            0 :                             state, format("... incorrect {}=\"{}\"", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2)));
    2828            0 :                         ShowContinueError(state, "... valid values are SupplyAirTemperature or TemperatureDifference.");
    2829            0 :                         ErrorsFound = true;
    2830              :                     }
    2831              :                 }
    2832              :                 //  N1, \field Zone Cooling Design Supply Air Temperature
    2833              :                 //      \type real
    2834              :                 //      \units C
    2835              :                 //      \note Zone Cooling Design Supply Air Temperature is only used when Zone Cooling Design
    2836              :                 //      \note Supply Air Temperature Input Method = SupplyAirTemperature
    2837         3702 :                 Real64 lowTempLimit = 0.0;
    2838         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(1)) {
    2839            0 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTemp = 0.0;
    2840         3702 :                 } else if (state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnCoolDgnSAMethod == SupplyAirTemperature) {
    2841         3647 :                     ReportTemperatureInputError(state, cCurrentModuleObject, 1, lowTempLimit, false, ErrorsFound);
    2842         3647 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTemp = state.dataIPShortCut->rNumericArgs(1);
    2843              :                 } else {
    2844           55 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTemp = 0.0;
    2845              :                 }
    2846              :                 //  N2, \field Zone Cooling Design Supply Air Temperature Difference
    2847              :                 //      \type real
    2848              :                 //      \units delta C
    2849              :                 //      \note Zone Cooling Design Supply Air Temperature is only used when Zone Cooling Design
    2850              :                 //      \note Supply Air Temperature Input Method = TemperatureDifference
    2851              :                 //      \note The absolute of this value is value will be subtracted from room temperature
    2852              :                 //      \note at peak load to calculate Zone Cooling Design Supply Air Temperature.
    2853         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(2)) {
    2854         3415 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTempDiff = 0.0;
    2855          287 :                 } else if (state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnCoolDgnSAMethod == TemperatureDifference) {
    2856           55 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTempDiff = state.dataIPShortCut->rNumericArgs(2);
    2857              :                 } else {
    2858          232 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTempDiff = 0.0;
    2859              :                 }
    2860              :                 //  A3, \field Zone Heating Design Supply Air Temperature Input Method
    2861              :                 //      \required-field
    2862              :                 //      \type choice
    2863              :                 //      \key SupplyAirTemperature
    2864              :                 //      \key TemperatureDifference
    2865              :                 //      \default SupplyAirTemperature
    2866              :                 {
    2867         3702 :                     std::string const &heatingSATMethod = state.dataIPShortCut->cAlphaArgs(3);
    2868         3702 :                     if (heatingSATMethod == "SUPPLYAIRTEMPERATURE") {
    2869         3647 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnHeatDgnSAMethod = SupplyAirTemperature;
    2870           55 :                     } else if (heatingSATMethod == "TEMPERATUREDIFFERENCE") {
    2871           55 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnHeatDgnSAMethod = TemperatureDifference;
    2872              :                     }
    2873              :                 }
    2874              :                 //  N3, \field Zone Heating Design Supply Air Temperature
    2875              :                 //      \type real
    2876              :                 //      \units C
    2877              :                 //      \note Zone Heating Design Supply Air Temperature is only used when Zone Heating Design
    2878              :                 //      \note Supply Air Temperature Input Method = SupplyAirTemperature
    2879         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(3)) {
    2880            0 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTemp = 0.0;
    2881         3702 :                 } else if (state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnHeatDgnSAMethod == SupplyAirTemperature) {
    2882         3647 :                     ReportTemperatureInputError(state, cCurrentModuleObject, 3, lowTempLimit, false, ErrorsFound);
    2883         3647 :                     ReportTemperatureInputError(
    2884         3647 :                         state, cCurrentModuleObject, 3, state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTemp, true, ErrorsFound);
    2885         3647 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTemp = state.dataIPShortCut->rNumericArgs(3);
    2886              :                 } else {
    2887           55 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTemp = 0.0;
    2888              :                 }
    2889              :                 //  N4, \field Zone Heating Design Supply Air Temperature Difference
    2890              :                 //      \type real
    2891              :                 //      \units deltaC
    2892              :                 //      \note Zone Heating Design Supply Air Temperature is only used when Zone Heating Design
    2893              :                 //      \note Supply Air Temperature Input Method = TemperatureDifference
    2894              :                 //      \note The absolute of this value is value will be added to room temperature
    2895              :                 //      \note at peak load to calculate Zone Heating Design Supply Air Temperature.
    2896         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(4)) {
    2897         3620 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTempDiff = 0.0;
    2898           82 :                 } else if (state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnHeatDgnSAMethod == TemperatureDifference) {
    2899           55 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTempDiff = state.dataIPShortCut->rNumericArgs(4);
    2900              :                 } else {
    2901           27 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTempDiff = 0.0;
    2902              :                 }
    2903              :                 //  N5, \field Zone Cooling Design Supply Air Humidity Ratio
    2904              :                 //      \required-field
    2905              :                 //      \minimum 0.0
    2906              :                 //      \type real
    2907              :                 //      \units kgWater/kgDryAir
    2908         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(5)) {
    2909            0 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesHumRat = 0.0;
    2910         3702 :                 } else if (state.dataIPShortCut->rNumericArgs(5) < 0.0) {
    2911            0 :                     ShowSevereError(state,
    2912            0 :                                     format("{}: incorrect {}: {:.2R}",
    2913              :                                            cCurrentModuleObject,
    2914            0 :                                            state.dataIPShortCut->cNumericFieldNames(5),
    2915            0 :                                            state.dataIPShortCut->rNumericArgs(5)));
    2916            0 :                     ShowContinueError(state,
    2917            0 :                                       format(".. value should not be negative. Occurs in Sizing Object={}", state.dataIPShortCut->cAlphaArgs(1)));
    2918            0 :                     ErrorsFound = true;
    2919              :                 } else {
    2920         3702 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesHumRat = state.dataIPShortCut->rNumericArgs(5);
    2921              :                 }
    2922              :                 //  N6, \field Zone Heating Design Supply Air Humidity Ratio
    2923              :                 //      \required-field
    2924              :                 //      \minimum 0.0
    2925              :                 //      \type real
    2926              :                 //      \units kgWater/kgDryAir
    2927         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(6)) {
    2928            0 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesHumRat = 0.0;
    2929         3702 :                 } else if (state.dataIPShortCut->rNumericArgs(6) < 0.0) {
    2930            0 :                     ShowSevereError(state,
    2931            0 :                                     format("{}: incorrect {}: {:.2R}",
    2932              :                                            cCurrentModuleObject,
    2933            0 :                                            state.dataIPShortCut->cNumericFieldNames(6),
    2934            0 :                                            state.dataIPShortCut->rNumericArgs(6)));
    2935            0 :                     ShowContinueError(state,
    2936            0 :                                       format(".. value should not be negative. Occurs in Sizing Object={}", state.dataIPShortCut->cAlphaArgs(1)));
    2937            0 :                     ErrorsFound = true;
    2938              :                 } else {
    2939         3702 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesHumRat = state.dataIPShortCut->rNumericArgs(6);
    2940              :                 }
    2941              :                 //  A4, \field Design Specification Outdoor Air Object Name
    2942              :                 //      \type object-list
    2943              :                 //      \object-list DesignSpecificationOutdoorAirNames
    2944         3702 :                 state.dataSize->ZoneSizingInput(ZoneSizIndex).DesignSpecOAObjName = state.dataIPShortCut->cAlphaArgs(4);
    2945              : 
    2946              :                 // Getting zone OA parameters from Design Specification object
    2947         3702 :                 if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) {
    2948              :                     int OAIndex =
    2949         3684 :                         Util::FindItemInList(state.dataSize->ZoneSizingInput(ZoneSizIndex).DesignSpecOAObjName, state.dataSize->OARequirements);
    2950         3684 :                     if (OAIndex > 0) {
    2951         3684 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneDesignSpecOAIndex = OAIndex;
    2952              :                     } else {
    2953            0 :                         ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    2954            0 :                         ShowContinueError(
    2955              :                             state,
    2956            0 :                             format("... incorrect {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(4), state.dataIPShortCut->cAlphaArgs(4)));
    2957            0 :                         ErrorsFound = true;
    2958              :                     }
    2959              :                 } else { // If no design spec object specified, i.e. no OA, then leave ZoneDesignSpecOAIndex = 0
    2960              :                 }
    2961              : 
    2962              :                 //  N7, \field Zone Heating Sizing Factor
    2963              :                 //      \note if blank, global heating sizing factor from Sizing:Parameters is used.
    2964              :                 //      \minimum> 0
    2965         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(7) || state.dataIPShortCut->rNumericArgs(7) == 0.0) {
    2966         3644 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatSizingFactor = state.dataSize->GlobalHeatSizingFactor;
    2967           58 :                 } else if (state.dataIPShortCut->rNumericArgs(7) < 0.0) {
    2968            0 :                     ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    2969            0 :                     ShowContinueError(state,
    2970            0 :                                       format("... incorrect {}=[{:.2R}],  value should not be negative.",
    2971            0 :                                              state.dataIPShortCut->cNumericFieldNames(7),
    2972            0 :                                              state.dataIPShortCut->rNumericArgs(7)));
    2973            0 :                     ErrorsFound = true;
    2974              :                 } else {
    2975           58 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatSizingFactor = state.dataIPShortCut->rNumericArgs(7);
    2976              :                 }
    2977              :                 //  N8, \field Zone Cooling Sizing Factor
    2978              :                 //      \note if blank, global cooling sizing factor from Sizing:Parameters is used.
    2979              :                 //      \minimum> 0
    2980         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(8) || state.dataIPShortCut->rNumericArgs(8) == 0.0) {
    2981         3644 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolSizingFactor = state.dataSize->GlobalCoolSizingFactor;
    2982           58 :                 } else if (state.dataIPShortCut->rNumericArgs(8) < 0.0) {
    2983            0 :                     ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    2984            0 :                     ShowContinueError(state,
    2985            0 :                                       format("... incorrect {}=[{:.2R}],  value should not be negative.",
    2986            0 :                                              state.dataIPShortCut->cNumericFieldNames(8),
    2987            0 :                                              state.dataIPShortCut->rNumericArgs(8)));
    2988            0 :                     ErrorsFound = true;
    2989              :                 } else {
    2990           58 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolSizingFactor = state.dataIPShortCut->rNumericArgs(8);
    2991              :                 }
    2992              :                 //  N9, \field Cooling Design Air Flow Rate
    2993              :                 //      \type real
    2994              :                 //      \units m3/s
    2995              :                 //      \minimum 0
    2996              :                 //      \default 0
    2997              :                 //      \note This input is used if Cooling Design Air Flow Method is Flow/Zone
    2998              :                 //      \note This value will be multiplied by the global or zone sizing factor and
    2999              :                 //      \note by zone multipliers.
    3000         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(9)) {
    3001         1913 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolAirFlow = 0.0;
    3002         1789 :                 } else if (state.dataIPShortCut->rNumericArgs(9) < 0.0) {
    3003            0 :                     ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    3004            0 :                     ShowContinueError(state,
    3005            0 :                                       format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3006            0 :                                              state.dataIPShortCut->cNumericFieldNames(9),
    3007            0 :                                              state.dataIPShortCut->rNumericArgs(9)));
    3008            0 :                     ErrorsFound = true;
    3009              :                 } else {
    3010         1789 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolAirFlow = state.dataIPShortCut->rNumericArgs(9);
    3011              :                 }
    3012              :                 //  N10,\field Cooling Minimum Air Flow per Zone Floor Area
    3013              :                 //      \type real
    3014              :                 //      \units m3/s-m2
    3015              :                 //      \minimum 0
    3016              :                 //      \default .000762
    3017              :                 //      \note default is .15 cfm/ft2
    3018              :                 //      \note This input is used if Cooling Design Air Flow Method is design day with limit
    3019         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(10)) {
    3020         3554 :                     if (state.dataIPShortCut->rNumericArgs(10) <= 0.0) { // in case someone changes the default in the IDD
    3021            0 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlowPerArea = 0.000762;
    3022              :                     } else {
    3023         3554 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlowPerArea = state.dataIPShortCut->rNumericArgs(10);
    3024              :                     }
    3025          148 :                 } else if (state.dataIPShortCut->rNumericArgs(10) < 0.0) {
    3026            0 :                     ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    3027            0 :                     ShowContinueError(state,
    3028            0 :                                       format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3029            0 :                                              state.dataIPShortCut->cNumericFieldNames(108),
    3030            0 :                                              state.dataIPShortCut->rNumericArgs(10)));
    3031            0 :                     ErrorsFound = true;
    3032              :                 } else {
    3033          148 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlowPerArea = state.dataIPShortCut->rNumericArgs(10);
    3034              :                 }
    3035              :                 //  N11,\field Cooling Minimum Air Flow
    3036              :                 //      \type real
    3037              :                 //      \units m3/s
    3038              :                 //      \minimum 0
    3039              :                 //      \default 0
    3040              :                 //      \note This input is used if Cooling Design Air Flow Method is design day with limit
    3041         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(11)) {
    3042         2587 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlow = 0.0;
    3043         1115 :                 } else if (state.dataIPShortCut->rNumericArgs(11) < 0.0) {
    3044            0 :                     ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    3045            0 :                     ShowContinueError(state,
    3046            0 :                                       format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3047            0 :                                              state.dataIPShortCut->cNumericFieldNames(11),
    3048            0 :                                              state.dataIPShortCut->rNumericArgs(11)));
    3049            0 :                     ErrorsFound = true;
    3050              :                 } else {
    3051         1115 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlow = state.dataIPShortCut->rNumericArgs(11);
    3052              :                 }
    3053              :                 //  N12,\field Cooling Minimum Air Flow Fraction
    3054         3702 :                 if (state.dataIPShortCut->rNumericArgs(12) < 0.0) {
    3055            0 :                     ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    3056            0 :                     ShowContinueError(state,
    3057            0 :                                       format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3058            0 :                                              state.dataIPShortCut->cNumericFieldNames(12),
    3059            0 :                                              state.dataIPShortCut->rNumericArgs(12)));
    3060            0 :                     ErrorsFound = true;
    3061              :                 } else {
    3062         3702 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlowFrac = state.dataIPShortCut->rNumericArgs(12);
    3063              :                 }
    3064              : 
    3065              :                 //  N13,\field Heating Design Air Flow Rate
    3066              :                 //      \type real
    3067              :                 //      \units m3/s
    3068              :                 //      \minimum 0
    3069              :                 //      \default 0
    3070              :                 //      \note This input is used if Heating Design Air Flow Method is Flow/Zone.
    3071              :                 //      \note This value will be multiplied by the global or zone sizing factor and
    3072              :                 //      \note by zone multipliers.
    3073         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(13)) {
    3074         1172 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatAirFlow = 0.0;
    3075         2530 :                 } else if (state.dataIPShortCut->rNumericArgs(13) < 0.0) {
    3076            0 :                     ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    3077            0 :                     ShowContinueError(state,
    3078            0 :                                       format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3079            0 :                                              state.dataIPShortCut->cNumericFieldNames(13),
    3080            0 :                                              state.dataIPShortCut->rNumericArgs(13)));
    3081            0 :                     ErrorsFound = true;
    3082              :                 } else {
    3083         2530 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatAirFlow = state.dataIPShortCut->rNumericArgs(13);
    3084              :                 }
    3085              :                 //  N14,\field Heating Maximum Air Flow per Zone Floor Area
    3086              :                 //      \type real
    3087              :                 //      \units m3/s-m2
    3088              :                 //      \minimum 0
    3089              :                 //      \default .002032
    3090              :                 //      \note default is .40 cfm/ft2
    3091              :                 //      \note This input is not currently used for autosizing any of the components.
    3092         3702 :                 bool DesHeatMaxAirFlowPerAreaUsrInp = false;
    3093         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(14)) {
    3094         3615 :                     if (state.dataIPShortCut->rNumericArgs(14) <= 0.0) { // in case someone changes the default in the IDD
    3095            0 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowPerArea = 0.002032;
    3096              :                     } else {
    3097         3615 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowPerArea = state.dataIPShortCut->rNumericArgs(14);
    3098              :                     }
    3099           87 :                 } else if (state.dataIPShortCut->rNumericArgs(14) < 0.0) {
    3100            0 :                     ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    3101            0 :                     ShowContinueError(state,
    3102            0 :                                       format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3103            0 :                                              state.dataIPShortCut->cNumericFieldNames(14),
    3104            0 :                                              state.dataIPShortCut->rNumericArgs(14)));
    3105            0 :                     ErrorsFound = true;
    3106              :                 } else {
    3107           87 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowPerArea = state.dataIPShortCut->rNumericArgs(14);
    3108           87 :                     DesHeatMaxAirFlowPerAreaUsrInp = true;
    3109              :                 }
    3110              :                 //  N15,\field Heating Maximum Air Flow
    3111              :                 //      \type real
    3112              :                 //      \units m3/s
    3113              :                 //      \minimum 0
    3114              :                 //      \default .1415762
    3115              :                 //      \note default is 300 cfm
    3116              :                 //      \note This input is not currently used for autosizing any of the components.
    3117         3702 :                 bool DesHeatMaxAirFlowUsrInp = false;
    3118         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(15)) {
    3119         3615 :                     if (state.dataIPShortCut->rNumericArgs(15) <= 0.0) { // in case someone changes the default in the IDD
    3120            0 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlow = 0.1415762;
    3121              :                     } else {
    3122         3615 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlow = state.dataIPShortCut->rNumericArgs(15);
    3123              :                     }
    3124           87 :                 } else if (state.dataIPShortCut->rNumericArgs(15) < 0.0) {
    3125            0 :                     ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    3126            0 :                     ShowContinueError(state,
    3127            0 :                                       format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3128            0 :                                              state.dataIPShortCut->cNumericFieldNames(15),
    3129            0 :                                              state.dataIPShortCut->rNumericArgs(15)));
    3130            0 :                     ErrorsFound = true;
    3131              :                 } else {
    3132           87 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlow = state.dataIPShortCut->rNumericArgs(15);
    3133           87 :                     DesHeatMaxAirFlowUsrInp = true;
    3134              :                 }
    3135              :                 //  N16;\field Heating Maximum Air Flow Fraction
    3136              :                 //      \note fraction of the Heating Design Air Flow Rate
    3137              :                 //      \note This input is not currently used for autosizing any of the components.
    3138              :                 //      \type real
    3139              :                 //      \minimum 0
    3140              :                 //      \default 0.3
    3141         3702 :                 bool DesHeatMaxAirFlowFracUsrInp = false;
    3142         3702 :                 if (state.dataIPShortCut->lNumericFieldBlanks(16)) {
    3143         3154 :                     if (state.dataIPShortCut->rNumericArgs(16) <= 0.0) { // in case someone changes the default in the IDD
    3144            0 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowFrac = 0.3;
    3145              :                     } else {
    3146         3154 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowFrac = state.dataIPShortCut->rNumericArgs(16);
    3147              :                     }
    3148          548 :                 } else if (state.dataIPShortCut->rNumericArgs(16) < 0.0) {
    3149            0 :                     ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    3150            0 :                     ShowContinueError(state,
    3151            0 :                                       format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3152            0 :                                              state.dataIPShortCut->cNumericFieldNames(16),
    3153            0 :                                              state.dataIPShortCut->rNumericArgs(16)));
    3154            0 :                     ErrorsFound = true;
    3155              :                 } else {
    3156          548 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowFrac = state.dataIPShortCut->rNumericArgs(16);
    3157          548 :                     DesHeatMaxAirFlowFracUsrInp = true;
    3158              :                 }
    3159              :                 // make sure the user specified inputs of the previous 3 inputs override the defaults
    3160         3702 :                 if (DesHeatMaxAirFlowPerAreaUsrInp || DesHeatMaxAirFlowUsrInp || DesHeatMaxAirFlowFracUsrInp) {
    3161          549 :                     if (!DesHeatMaxAirFlowPerAreaUsrInp) {
    3162          462 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowPerArea = 0.0;
    3163              :                     }
    3164          549 :                     if (!DesHeatMaxAirFlowUsrInp) {
    3165          462 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlow = 0.0;
    3166              :                     }
    3167          549 :                     if (!DesHeatMaxAirFlowFracUsrInp) {
    3168            1 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowFrac = 0.0;
    3169              :                     }
    3170              :                 }
    3171              : 
    3172              :                 //  A7, \field Zone Air Distribution Object Name and add its inputs
    3173         3702 :                 if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) {
    3174          624 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneAirDistEffObjName = state.dataIPShortCut->cAlphaArgs(7);
    3175          624 :                     int ObjIndex = Util::FindItemInList(state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneAirDistEffObjName,
    3176          624 :                                                         state.dataSize->ZoneAirDistribution);
    3177          624 :                     if (ObjIndex > 0) {
    3178          624 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneADEffCooling =
    3179          624 :                             state.dataSize->ZoneAirDistribution(ObjIndex).ZoneADEffCooling;
    3180          624 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneADEffHeating =
    3181          624 :                             state.dataSize->ZoneAirDistribution(ObjIndex).ZoneADEffHeating;
    3182          624 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneSecondaryRecirculation =
    3183          624 :                             state.dataSize->ZoneAirDistribution(ObjIndex).ZoneSecondaryRecirculation;
    3184          624 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneAirDistributionIndex = ObjIndex;
    3185          624 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneVentilationEff =
    3186          624 :                             state.dataSize->ZoneAirDistribution(ObjIndex).ZoneVentilationEff;
    3187              :                     } else {
    3188              :                         // generate a warning message
    3189            0 :                         ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    3190            0 :                         ShowContinueError(
    3191              :                             state,
    3192            0 :                             format("... not found {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(7), state.dataIPShortCut->cAlphaArgs(7)));
    3193            0 :                         ErrorsFound = true;
    3194              :                     }
    3195              :                 } else {
    3196              :                     // assume defaults
    3197         3078 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneADEffCooling = 1.0;
    3198         3078 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneADEffHeating = 1.0;
    3199         3078 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneSecondaryRecirculation = 0.0;
    3200              :                 }
    3201              : 
    3202              :                 constexpr static std::array<std::string_view, static_cast<int>(DataSizing::AirflowSizingMethod::Num)> AirflowSizingMethodNamesUC = {
    3203              :                     "DESIGNDAY", "FLOW/ZONE", "DESIGNDAYWITHLIMIT"};
    3204         3702 :                 state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolAirDesMethod =
    3205         7404 :                     static_cast<AirflowSizingMethod>(getEnumValue(AirflowSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(5))));
    3206         3702 :                 assert(state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolAirDesMethod != AirflowSizingMethod::Invalid);
    3207         3702 :                 state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatAirDesMethod =
    3208         7404 :                     static_cast<AirflowSizingMethod>(getEnumValue(AirflowSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(6))));
    3209         3702 :                 assert(state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatAirDesMethod != AirflowSizingMethod::Invalid);
    3210              : 
    3211         3702 :                 BooleanSwitch accountForDOAS = getYesNoValue(state.dataIPShortCut->cAlphaArgs(8));
    3212         3702 :                 state.dataSize->ZoneSizingInput(ZoneSizIndex).AccountForDOAS = (accountForDOAS == BooleanSwitch::Yes) ? true : false;
    3213              : 
    3214         3702 :                 if (state.dataSize->ZoneSizingInput(ZoneSizIndex).AccountForDOAS) {
    3215              :                     constexpr static std::array<std::string_view, static_cast<int>(DataSizing::DOASControl::Num)> DOASControlNamesUC = {
    3216              :                         "NEUTRALSUPPLYAIR", "NEUTRALDEHUMIDIFIEDSUPPLYAIR", "COLDSUPPLYAIR"};
    3217           72 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASControlStrategy =
    3218          144 :                         static_cast<DataSizing::DOASControl>(getEnumValue(DOASControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(9))));
    3219              : 
    3220           72 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASLowSetpoint = state.dataIPShortCut->rNumericArgs(17);
    3221           72 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASHighSetpoint = state.dataIPShortCut->rNumericArgs(18);
    3222          144 :                     if (state.dataIPShortCut->rNumericArgs(17) > 0.0 && state.dataIPShortCut->rNumericArgs(18) > 0.0 &&
    3223           72 :                         state.dataIPShortCut->rNumericArgs(17) >= state.dataIPShortCut->rNumericArgs(18)) {
    3224            0 :                         ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    3225            0 :                         ShowContinueError(state, "... Dedicated Outside Air Low Setpoint for Design must be less than the High Setpoint");
    3226            0 :                         ErrorsFound = true;
    3227              :                     }
    3228              :                 }
    3229         3702 :                 zoneSizingIndex.spaceConcurrence = static_cast<DataSizing::SizingConcurrence>(
    3230         3702 :                     getEnumValue(DataSizing::SizingConcurrenceNamesUC, state.dataIPShortCut->cAlphaArgs(15)));
    3231         3702 :                 zoneSizingIndex.zoneSizingMethod =
    3232         3702 :                     static_cast<DataSizing::ZoneSizing>(getEnumValue(DataSizing::ZoneSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(10)));
    3233         3702 :                 if (zoneSizingIndex.zoneSizingMethod != ZoneSizing::SensibleOnly) {
    3234            8 :                     zoneSizingIndex.zoneLatentSizing = true;
    3235            8 :                     state.dataHeatBal->DoLatentSizing = true;
    3236              :                 }
    3237         3702 :                 zoneSizingIndex.ZnLatCoolDgnSAMethod =
    3238         3702 :                     (state.dataIPShortCut->cAlphaArgs(11) == "SUPPLYAIRHUMIDITYRATIO") ? SupplyAirHumidityRatio : HumidityRatioDifference;
    3239         3702 :                 zoneSizingIndex.LatentCoolDesHumRat = state.dataIPShortCut->rNumericArgs(19);
    3240         3702 :                 zoneSizingIndex.CoolDesHumRatDiff = state.dataIPShortCut->rNumericArgs(20);
    3241         3702 :                 zoneSizingIndex.ZnLatHeatDgnSAMethod =
    3242         3702 :                     (state.dataIPShortCut->cAlphaArgs(12) == "SUPPLYAIRHUMIDITYRATIO") ? SupplyAirHumidityRatio : HumidityRatioDifference;
    3243         3702 :                 zoneSizingIndex.LatentHeatDesHumRat = state.dataIPShortCut->rNumericArgs(21);
    3244         3702 :                 zoneSizingIndex.HeatDesHumRatDiff = state.dataIPShortCut->rNumericArgs(22);
    3245              : 
    3246         3702 :                 if (NumAlphas <= 12 || state.dataIPShortCut->lAlphaFieldBlanks(13)) {
    3247            3 :                 } else if ((zoneSizingIndex.zoneRHDehumidifySched = Sched::GetSchedule(state, state.dataIPShortCut->cAlphaArgs(13))) == nullptr) {
    3248            0 :                     ShowWarningItemNotFound(state,
    3249              :                                             eoh,
    3250            0 :                                             state.dataIPShortCut->cAlphaFieldNames(13),
    3251            0 :                                             state.dataIPShortCut->cAlphaArgs(13),
    3252              :                                             "Schedule will not be used and simulation continues.");
    3253              :                 }
    3254              : 
    3255         3702 :                 if (NumAlphas <= 13 || state.dataIPShortCut->lAlphaFieldBlanks(14)) {
    3256            3 :                 } else if ((zoneSizingIndex.zoneRHHumidifySched = Sched::GetSchedule(state, state.dataIPShortCut->cAlphaArgs(14))) == nullptr) {
    3257            0 :                     ShowWarningItemNotFound(state,
    3258              :                                             eoh,
    3259            0 :                                             state.dataIPShortCut->cAlphaFieldNames(14),
    3260            0 :                                             state.dataIPShortCut->cAlphaArgs(14),
    3261              :                                             "Schedule will not be used and simulation continues.");
    3262            3 :                 } else if (zoneSizingIndex.zoneRHDehumidifySched) {
    3263              :                     // check max and min of each schedule and compare RHHumidify > RHDehumidify and warn
    3264            3 :                     Real64 maxHumidify = zoneSizingIndex.zoneRHHumidifySched->getMaxVal(state);
    3265            3 :                     Real64 minDehumidify = zoneSizingIndex.zoneRHDehumidifySched->getMinVal(state);
    3266            3 :                     if (maxHumidify > minDehumidify) {
    3267            0 :                         ShowWarningCustom(state,
    3268              :                                           eoh,
    3269            0 :                                           format("Maximum value ({}%) of Zone Humidistat Humidification Set Point Schedule Name = {} is "
    3270              :                                                  "greater than minimum value ({}%) of Zone Humidistat Dehumidifcation Set Point Schedule Name = {}. "
    3271              :                                                  "Humidification set point will be limited by Dehumidification set point during zone sizing and "
    3272              :                                                  "simulation continues.",
    3273              :                                                  maxHumidify,
    3274            0 :                                                  state.dataIPShortCut->cAlphaArgs(14),
    3275              :                                                  minDehumidify,
    3276            0 :                                                  state.dataIPShortCut->cAlphaArgs(13)));
    3277              :                     }
    3278              :                 }
    3279              :             }
    3280              :         }
    3281              :     }
    3282              : 
    3283          801 :     if (ErrorsFound) {
    3284            0 :         ShowFatalError(state, format("{}: Errors found in getting input. Program terminates.", cCurrentModuleObject));
    3285              :     }
    3286          801 : }
    3287              : 
    3288        10941 : void ReportTemperatureInputError(
    3289              :     EnergyPlusData &state, std::string cObjectName, int const paramNum, Real64 comparisonTemperature, bool const shouldFlagSevere, bool &ErrorsFound)
    3290              : {
    3291        10941 :     if (state.dataIPShortCut->rNumericArgs(paramNum) < comparisonTemperature) {
    3292            0 :         if (shouldFlagSevere) { // heating supply air temperature is lower than cooling supply air temperature--not allowed
    3293            0 :             ShowSevereError(state, format("{}=\"{}\" has invalid data.", cObjectName, state.dataIPShortCut->cAlphaArgs(1)));
    3294            0 :             ShowContinueError(state,
    3295            0 :                               format("... incorrect {}=[{:.2R}] is less than {}=[{:.2R}]",
    3296            0 :                                      state.dataIPShortCut->cNumericFieldNames(paramNum),
    3297            0 :                                      state.dataIPShortCut->rNumericArgs(paramNum),
    3298            0 :                                      state.dataIPShortCut->cNumericFieldNames(paramNum - 2),
    3299            0 :                                      state.dataIPShortCut->rNumericArgs(paramNum - 2)));
    3300            0 :             ShowContinueError(state, "This is not allowed.  Please check and revise your input.");
    3301            0 :             ErrorsFound = true;
    3302              :         } else { // then input is lower than comparison temperature--just produce a warning for user to check input
    3303            0 :             ShowWarningError(state, format("{}=\"{}\" has invalid data.", cObjectName, state.dataIPShortCut->cAlphaArgs(1)));
    3304            0 :             ShowContinueError(state,
    3305            0 :                               format("... incorrect {}=[{:.2R}] is less than [{:.2R}]",
    3306            0 :                                      state.dataIPShortCut->cNumericFieldNames(paramNum),
    3307            0 :                                      state.dataIPShortCut->rNumericArgs(paramNum),
    3308              :                                      comparisonTemperature));
    3309            0 :             ShowContinueError(state, "Please check your input to make sure this is correct.");
    3310              :         }
    3311              :     }
    3312        10941 : }
    3313              : 
    3314          442 : void GetZoneAndZoneListNames(
    3315              :     EnergyPlusData &state, bool &ErrorsFound, int &NumZones, Array1D_string &ZoneNames, int &NumZoneLists, Array1D<ZoneListData> &ZoneListNames)
    3316              : {
    3317              : 
    3318              :     // SUBROUTINE INFORMATION:
    3319              :     //       AUTHOR         Linda Lawrie
    3320              :     //       DATE WRITTEN   October 2010
    3321              : 
    3322              :     // PURPOSE OF THIS SUBROUTINE:
    3323              :     // Get Zone and ZoneList Names so Sizing:Zone can use global ZoneList.
    3324              :     // This is not a full validation of these objects -- only enough to fill
    3325              :     // structures for the Sizing:Zone object.
    3326              : 
    3327              :     // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    3328              :     int Found;
    3329              :     int NumAlphas;
    3330              :     int NumNumbers;
    3331              :     int IOStatus;
    3332              : 
    3333          442 :     auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
    3334          442 :     cCurrentModuleObject = "Zone";
    3335          442 :     NumZones = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    3336          442 :     ZoneNames.allocate(NumZones);
    3337              : 
    3338         4677 :     for (int Item = 1; Item <= NumZones; ++Item) {
    3339         8470 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    3340              :                                                                  cCurrentModuleObject,
    3341              :                                                                  Item,
    3342         4235 :                                                                  state.dataIPShortCut->cAlphaArgs,
    3343              :                                                                  NumAlphas,
    3344         4235 :                                                                  state.dataIPShortCut->rNumericArgs,
    3345              :                                                                  NumNumbers,
    3346              :                                                                  IOStatus,
    3347         4235 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    3348         4235 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    3349         4235 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    3350         4235 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    3351              :         // validation, but no error
    3352         4235 :         Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneNames, Item - 1);
    3353         4235 :         if (Found == 0) {
    3354         4235 :             ZoneNames(Item) = state.dataIPShortCut->cAlphaArgs(1);
    3355              :         } else {
    3356            0 :             ZoneNames(Item) = "xxxxx";
    3357              :         }
    3358              :     }
    3359              : 
    3360          442 :     cCurrentModuleObject = "ZoneList";
    3361          442 :     NumZoneLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    3362          442 :     ZoneListNames.allocate(NumZoneLists);
    3363              : 
    3364          478 :     for (int Item = 1; Item <= NumZoneLists; ++Item) {
    3365           72 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    3366              :                                                                  cCurrentModuleObject,
    3367              :                                                                  Item,
    3368           36 :                                                                  state.dataIPShortCut->cAlphaArgs,
    3369              :                                                                  NumAlphas,
    3370           36 :                                                                  state.dataIPShortCut->rNumericArgs,
    3371              :                                                                  NumNumbers,
    3372              :                                                                  IOStatus,
    3373           36 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    3374           36 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    3375           36 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    3376           36 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    3377              :         // validation, but no error
    3378           36 :         Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneListNames, Item - 1);
    3379           36 :         if (Found == 0) {
    3380           36 :             ZoneListNames(Item).Name = state.dataIPShortCut->cAlphaArgs(1);
    3381              :         } else {
    3382            0 :             ZoneListNames(Item).Name = "xxxxx";
    3383              :         }
    3384           36 :         ZoneListNames(Item).Zones.allocate(NumAlphas - 1);
    3385           36 :         ZoneListNames(Item).NumOfZones = NumAlphas - 1;
    3386          311 :         for (int Item1 = 2; Item1 <= NumAlphas; ++Item1) {
    3387          275 :             Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(Item1), ZoneNames, NumZones);
    3388          275 :             ZoneListNames(Item).Zones(Item1 - 1) = Found;
    3389              :         }
    3390              :     }
    3391          442 : }
    3392              : 
    3393          801 : void GetSystemSizingInput(EnergyPlusData &state)
    3394              : {
    3395              : 
    3396              :     // SUBROUTINE INFORMATION:
    3397              :     //       AUTHOR         Fred Buhl
    3398              :     //       DATE WRITTEN   January 2001
    3399              : 
    3400              :     // PURPOSE OF THIS SUBROUTINE:
    3401              :     // Obtains input data for System Sizing objects and stores it in
    3402              :     // appropriate data structures.
    3403              : 
    3404              :     // METHODOLOGY EMPLOYED:
    3405              :     // Uses InputProcessor "Get" routines to obtain data.
    3406              : 
    3407              :     // Sizing:System;
    3408          801 :     constexpr int iNameAlphaNum = 1;                          // A1, \field AirLoop Name
    3409          801 :     constexpr int iLoadTypeSizeAlphaNum = 2;                  // A2, \field Type of Load to Size On
    3410          801 :     constexpr int iCoolCapControlAlphaNum = 11;               // A11 \field Central Cooling Capacity Control Method
    3411          801 :     constexpr int iDesignOAVolFlowNumericNum = 1;             // N1, \field Design Outdoor Air Flow Rate
    3412          801 :     constexpr int iMinSysAirFlowRatioNumericNum = 2;          // N2, \field Minimum System Air Flow Ratio
    3413          801 :     constexpr int iPreheatDesignTempNumericNum = 3;           // N3, \field Preheat Design Temperature
    3414          801 :     constexpr int iPreheatDesignHumRatNumericNum = 4;         // N4, \field Preheat Design Humidity Ratio
    3415          801 :     constexpr int iPrecoolDesignTempNumericNum = 5;           // N5, \field Precool Design Temperature
    3416          801 :     constexpr int iPrecoolDesignHumRatNumericNum = 6;         // N6, \field Precool Design Humidity Ratio
    3417          801 :     constexpr int iCentralCoolDesignSATempNumericNum = 7;     // N7, \field Central Cooling Design Supply Air Temperature
    3418          801 :     constexpr int iCentralHeatDesignSATempNumericNum = 8;     // N8, \field Central Heating Design Supply Air Temperature
    3419          801 :     constexpr int iSizingOptionAlphaNum = 3;                  //  A3, \field Sizing Option
    3420          801 :     constexpr int i100PercentOACoolingAlphaNum = 4;           //  A4, \field 100% Outdoor Air in Cooling
    3421          801 :     constexpr int i100PercentOAHeatingAlphaNum = 5;           //  A5, \field 100% Outdoor Air in Heating
    3422          801 :     constexpr int iCentralCoolDesignSAHumRatNumericNum = 9;   // N9, \field Central Cooling Design Supply Air Humidity Ratio
    3423          801 :     constexpr int iCentralHeatDesignSAHumRatNumericNum = 10;  // N10, \field Central Heating Design Supply Air Humidity Ratio
    3424          801 :     constexpr int iCoolSAFMAlphaNum = 6;                      // A6, \field Cooling Design Air Flow Method
    3425          801 :     constexpr int iMaxCoolAirVolFlowNumericNum = 11;          // N11, \field Cooling Design Air Flow Rate {m3/s}
    3426          801 :     constexpr int iCoolFlowPerFloorAreaNumericNum = 12;       // N12, \field Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2}
    3427          801 :     constexpr int iCoolFlowPerFracCoolNumericNum = 13;        // N13, \field Fraction of Autosized Design Cooling Supply Air Flow Rate {-}
    3428          801 :     constexpr int iCoolFlowPerCoolCapNumericNum = 14;         // N14, \field Design Supply Air Flow Rate Per Unit Cooling Capacity {m3/s-W}
    3429          801 :     constexpr int iHeatSAFMAlphaNum = 7;                      // A7, \field Heating Design Air Flow Method
    3430          801 :     constexpr int iMaxHeatAirVolFlowNumericNum = 15;          // N15, \field Heating Design Air Flow Rate {m3/s}
    3431          801 :     constexpr int iHeatFlowPerFloorAreaNumericNum = 16;       // N16, \field Supply Air Flow Rate Per Floor Area During Heating Operation {m3/s-m2}
    3432          801 :     constexpr int iHeatFlowPerFracHeatNumericNum = 17;        // N17, \field Fraction of Autosized Design Heating Supply Air Flow Rate {-}
    3433          801 :     constexpr int iHeatFlowPerFracCoolNumericNum = 18;        // N18, \field Fraction of Autosized Design Cooling Supply Air Flow Rate {-}
    3434          801 :     constexpr int iHeatFlowPerHeatCapNumericNum = 19;         // N19, \field Design Supply Air Flow Rate Per Unit Heating Capacity {m3/s-W}
    3435          801 :     constexpr int iSystemOASMethodAlphaNum = 8;               // A8,  \field System Outdoor Air Method
    3436          801 :     constexpr int iZoneMaxOAFractionNumericNum = 20;          // N20, \field Zone Maximum Outdoor Air Fraction
    3437          801 :     constexpr int iCoolCAPMAlphaNum(9);                       // A9, \field Cooling Design Capacity Method
    3438          801 :     constexpr int iCoolDesignCapacityNumericNum(21);          // N21, \field Cooling Design Capacity {W}
    3439          801 :     constexpr int iCoolCapacityPerFloorAreaNumericNum(22);    // N22, \field Cooling Design Capacity Per Floor Area {W/m2}
    3440          801 :     constexpr int iCoolFracOfAutosizedCapacityNumericNum(23); // N23, \field Fraction of Autosized Cooling Design Capacity {-}
    3441          801 :     constexpr int iHeatCAPMAlphaNum(10);                      // A10, \field Heating Design Capacity Method
    3442          801 :     constexpr int iHeatDesignCapacityNumericNum(24);          // N24, \field Heating Design Capacity {W}
    3443          801 :     constexpr int iHeatCapacityPerFloorAreaNumericNum(25);    // N25, \field Heating Design Capacity Per Floor Area {W/m2}
    3444          801 :     constexpr int iHeatFracOfAutosizedCapacityNumericNum(26); // N26, \field Fraction of Autosized Cooling Design Capacity {-}
    3445          801 :     constexpr int iOccupantDiversity = 27;                    // N26, \field Occupant Diversity
    3446              : 
    3447              :     // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    3448              :     int SysSizIndex;         // loop index
    3449              :     int NumAlphas;           // Number of Alphas for each GetObjectItem call
    3450              :     int NumNumbers;          // Number of Numbers for each GetObjectItem call
    3451              :     int IOStatus;            // Used in GetObjectItem
    3452          801 :     bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine
    3453              : 
    3454          801 :     auto &SysSizInput = state.dataSize->SysSizInput;
    3455              : 
    3456          801 :     state.dataSizingManager->NumAirLoops = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "AirLoopHVAC");
    3457          801 :     auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
    3458          801 :     cCurrentModuleObject = "Sizing:System";
    3459          801 :     state.dataSize->NumSysSizInput = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    3460              : 
    3461          801 :     if (state.dataSize->NumSysSizInput > 0) {
    3462          354 :         int NumDesDays = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:DesignDay") +
    3463          354 :                          state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileDays") +
    3464          354 :                          state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileConditionType");
    3465          354 :         if (NumDesDays == 0 && (state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing)) {
    3466            0 :             ShowSevereError(state, "System Sizing calculations need SizingPeriod:* input. None found.");
    3467            0 :             ErrorsFound = true;
    3468              :         }
    3469          354 :         SysSizInput.allocate(state.dataSize->NumSysSizInput);
    3470              :     }
    3471              : 
    3472         1781 :     for (SysSizIndex = 1; SysSizIndex <= state.dataSize->NumSysSizInput; ++SysSizIndex) {
    3473         1960 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    3474              :                                                                  cCurrentModuleObject,
    3475              :                                                                  SysSizIndex,
    3476          980 :                                                                  state.dataIPShortCut->cAlphaArgs,
    3477              :                                                                  NumAlphas,
    3478          980 :                                                                  state.dataIPShortCut->rNumericArgs,
    3479              :                                                                  NumNumbers,
    3480              :                                                                  IOStatus,
    3481          980 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    3482          980 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    3483          980 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    3484          980 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    3485          980 :         assert(!state.dataIPShortCut->cAlphaArgs(iNameAlphaNum).empty());
    3486              : 
    3487          980 :         SysSizInput(SysSizIndex).AirPriLoopName = state.dataIPShortCut->cAlphaArgs(iNameAlphaNum);
    3488              : 
    3489          980 :         constexpr std::array<std::string_view, static_cast<int>(DataSizing::LoadSizing::Num)> LoadSizingNamesUC{
    3490              :             "SENSIBLE", "LATENT", "TOTAL", "VENTILATIONREQUIREMENT"};
    3491         1960 :         SysSizInput(SysSizIndex).loadSizingType = static_cast<DataSizing::LoadSizing>(
    3492          980 :             getEnumValue(LoadSizingNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(iLoadTypeSizeAlphaNum))));
    3493              : 
    3494              :         // assign PeakLoad based on LoadSizing for now
    3495          980 :         if (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Sensible) {
    3496          935 :             SysSizInput(SysSizIndex).coolingPeakLoad = DataSizing::PeakLoad::SensibleCooling;
    3497           81 :         } else if (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Total ||
    3498           36 :                    (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Latent && state.dataHeatBal->DoLatentSizing)) {
    3499           10 :             SysSizInput(SysSizIndex).coolingPeakLoad = DataSizing::PeakLoad::TotalCooling;
    3500              :         } else {
    3501           35 :             SysSizInput(SysSizIndex).coolingPeakLoad = DataSizing::PeakLoad::SensibleCooling;
    3502              :         }
    3503              :         // set the CoolCapControl input
    3504          980 :         constexpr std::array<std::string_view, static_cast<int>(CapacityControl::Num)> CapacityControlNamesUC{"VAV", "BYPASS", "VT", "ONOFF"};
    3505         1960 :         SysSizInput(SysSizIndex).CoolCapControl = static_cast<CapacityControl>(
    3506          980 :             getEnumValue(CapacityControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(iCoolCapControlAlphaNum))));
    3507              : 
    3508              :         {
    3509          980 :             std::string const &sizingOption = state.dataIPShortCut->cAlphaArgs(iSizingOptionAlphaNum);
    3510          980 :             if (sizingOption == "COINCIDENT") {
    3511           95 :                 SysSizInput(SysSizIndex).SizingOption = DataSizing::SizingConcurrence::Coincident;
    3512          885 :             } else if (sizingOption == "NONCOINCIDENT") {
    3513          885 :                 SysSizInput(SysSizIndex).SizingOption = DataSizing::SizingConcurrence::NonCoincident;
    3514              :             } else {
    3515            0 :                 ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3516            0 :                 ShowContinueError(state,
    3517            0 :                                   format("... incorrect {}=\"{}\".",
    3518            0 :                                          state.dataIPShortCut->cAlphaFieldNames(iSizingOptionAlphaNum),
    3519            0 :                                          state.dataIPShortCut->cAlphaArgs(iSizingOptionAlphaNum)));
    3520            0 :                 ShowContinueError(state, "... valid values are Coincident or NonCoincident.");
    3521            0 :                 ErrorsFound = true;
    3522              :             }
    3523              :         }
    3524              : 
    3525          980 :         BooleanSwitch is100PctOACooling = getYesNoValue(state.dataIPShortCut->cAlphaArgs(i100PercentOACoolingAlphaNum));
    3526          980 :         SysSizInput(SysSizIndex).CoolOAOption = (is100PctOACooling == BooleanSwitch::Yes) ? OAControl::AllOA : OAControl::MinOA;
    3527              : 
    3528          980 :         BooleanSwitch is100PctOAHeating = getYesNoValue(state.dataIPShortCut->cAlphaArgs(i100PercentOAHeatingAlphaNum));
    3529          980 :         SysSizInput(SysSizIndex).HeatOAOption = (is100PctOAHeating == BooleanSwitch::Yes) ? OAControl::AllOA : OAControl::MinOA;
    3530              : 
    3531              :         //  N1, \field Design Outdoor Air Flow Rate
    3532              :         //      \type real
    3533              :         //      \default autosize
    3534              :         //      \minimum 0.0
    3535              :         // int const  iDesignOAVolFlowNumericNum = 1;     // N1, \field Design Outdoor Air Flow Rate
    3536          980 :         if (state.dataIPShortCut->lNumericFieldBlanks(iDesignOAVolFlowNumericNum)) {
    3537            0 :             SysSizInput(SysSizIndex).DesOutAirVolFlow = AutoSize;
    3538         1914 :         } else if (state.dataIPShortCut->rNumericArgs(iDesignOAVolFlowNumericNum) < 0.0 &&
    3539          934 :                    state.dataIPShortCut->rNumericArgs(iDesignOAVolFlowNumericNum) != AutoSize) {
    3540            0 :             ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3541            0 :             ShowContinueError(state,
    3542            0 :                               format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3543            0 :                                      state.dataIPShortCut->cNumericFieldNames(iDesignOAVolFlowNumericNum),
    3544            0 :                                      state.dataIPShortCut->rNumericArgs(iDesignOAVolFlowNumericNum)));
    3545            0 :             ErrorsFound = true;
    3546              :         } else {
    3547          980 :             SysSizInput(SysSizIndex).DesOutAirVolFlow = state.dataIPShortCut->rNumericArgs(iDesignOAVolFlowNumericNum);
    3548              :         }
    3549          980 :         if (SysSizInput(SysSizIndex).DesOutAirVolFlow == AutoSize) {
    3550          934 :             SysSizInput(SysSizIndex).OAAutoSized = true;
    3551              :         }
    3552              : 
    3553              :         //  N2, \field Minimum System Air Flow Ratio
    3554              :         //      \required-field
    3555              :         //      \type real
    3556              :         //      \minimum 0.0
    3557              :         //      \maximum 1.0
    3558              :         // int const iMinSysAirFlowRatioNumericNum = 2;  // N2, \field Minimum System Air Flow Ratio
    3559          980 :         if (state.dataIPShortCut->lNumericFieldBlanks(iMinSysAirFlowRatioNumericNum)) {
    3560            0 :             SysSizInput(SysSizIndex).SysAirMinFlowRat = 0.0;
    3561          983 :         } else if ((state.dataIPShortCut->rNumericArgs(iMinSysAirFlowRatioNumericNum) < 0.0) &&
    3562            3 :                    (state.dataIPShortCut->rNumericArgs(iMinSysAirFlowRatioNumericNum) != DataSizing::AutoSize)) {
    3563            0 :             ShowSevereError(
    3564            0 :                 state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iMinSysAirFlowRatioNumericNum)));
    3565            0 :             ShowContinueError(state,
    3566            0 :                               format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3567            0 :                                      state.dataIPShortCut->cNumericFieldNames(iMinSysAirFlowRatioNumericNum),
    3568            0 :                                      state.dataIPShortCut->rNumericArgs(iMinSysAirFlowRatioNumericNum)));
    3569            0 :             ErrorsFound = true;
    3570              :         } else {
    3571          980 :             SysSizInput(SysSizIndex).SysAirMinFlowRat = state.dataIPShortCut->rNumericArgs(iMinSysAirFlowRatioNumericNum);
    3572          980 :             if (state.dataIPShortCut->rNumericArgs(iMinSysAirFlowRatioNumericNum) == DataSizing::AutoSize) {
    3573            3 :                 SysSizInput(SysSizIndex).SysAirMinFlowRatWasAutoSized = true;
    3574              :             }
    3575              :         }
    3576              :         // int const iPreheatDesignTempNumericNum = 3; // N3, \field Preheat Design Temperature
    3577              :         // int const iPreheatDesignHumRatNumericNum = 4; // N4, \field Preheat Design Humidity Ratio
    3578              :         // int const iPrecoolDesignTempNumericNum = 5; // N5, \field Precool Design Temperature
    3579              :         // int const iPrecoolDesignHumRatNumericNum = 6; // N6, \field Precool Design Humidity Ratio
    3580              :         // int const iCentralCoolDesignSATempNumericNum = 7; // N7, \field Central Cooling Design Supply Air Temperature
    3581              :         // int const iCentralHeatDesignSATempNumericNum = 8; // N8, \field Central Heating Design Supply Air Temperature
    3582              :         // int const iCentralCoolDesignSAHumRatNumericNum = 9; // N9, \field Central Cooling Design Supply Air Humidity Ratio
    3583              :         // int const iCentralHeatDesignSAHumRatNumericNum = 10; // N10, \field Central Heating Design Supply Air Humidity Ratio
    3584          980 :         SysSizInput(SysSizIndex).PreheatTemp = state.dataIPShortCut->rNumericArgs(iPreheatDesignTempNumericNum);
    3585          980 :         SysSizInput(SysSizIndex).PreheatHumRat = state.dataIPShortCut->rNumericArgs(iPreheatDesignHumRatNumericNum);
    3586          980 :         SysSizInput(SysSizIndex).PrecoolTemp = state.dataIPShortCut->rNumericArgs(iPrecoolDesignTempNumericNum);
    3587          980 :         SysSizInput(SysSizIndex).PrecoolHumRat = state.dataIPShortCut->rNumericArgs(iPrecoolDesignHumRatNumericNum);
    3588          980 :         SysSizInput(SysSizIndex).CoolSupTemp = state.dataIPShortCut->rNumericArgs(iCentralCoolDesignSATempNumericNum);
    3589          980 :         SysSizInput(SysSizIndex).HeatSupTemp = state.dataIPShortCut->rNumericArgs(iCentralHeatDesignSATempNumericNum);
    3590          980 :         SysSizInput(SysSizIndex).CoolSupHumRat = state.dataIPShortCut->rNumericArgs(iCentralCoolDesignSAHumRatNumericNum);
    3591          980 :         SysSizInput(SysSizIndex).HeatSupHumRat = state.dataIPShortCut->rNumericArgs(iCentralHeatDesignSAHumRatNumericNum);
    3592              :         //  N11, \field Cooling Design Air Flow Rate
    3593              :         //      \note This input is used if Cooling Design Air Flow Method is Flow/System
    3594              :         //      \note This value will *not* be multiplied by any sizing factor or by zone multipliers.
    3595              :         //      \note If using zone multipliers, this value must be large enough to serve the multiplied zones.
    3596              :         //      \type real
    3597              :         //      \units m3/s
    3598              :         //      \minimum 0
    3599              :         //      \default 0
    3600              :         // int const iCoolSAFMAlphaNum = 6; // A6, \field Cooling Design Air Flow Method
    3601              :         // int const iMaxCoolAirVolFlowNumericNum = 11; // N11, \field Cooling Design Air Flow Rate {m3/s}
    3602              :         // int const iCoolFlowPerFloorAreaNumericNum = 12; // N12, \field Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2}
    3603              :         // int const iCoolFlowPerFracCoolNumericNum = 13; // N13, \field Fraction of Autosized Design Cooling Supply Air Flow Rate {-}
    3604              :         // int const iCoolFlowPerCoolCapNumericNum = 14; // N14, \field Design Supply Air Flow Rate Per Unit Cooling Capacity {m3/s-W}
    3605              : 
    3606          980 :         if (state.dataIPShortCut->lNumericFieldBlanks(iMaxCoolAirVolFlowNumericNum)) {
    3607          172 :             SysSizInput(SysSizIndex).DesCoolAirFlow = 0.0;
    3608          808 :         } else if (state.dataIPShortCut->rNumericArgs(iMaxCoolAirVolFlowNumericNum) < 0.0) {
    3609            0 :             ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3610            0 :             ShowContinueError(state,
    3611            0 :                               format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3612            0 :                                      state.dataIPShortCut->cNumericFieldNames(iMaxCoolAirVolFlowNumericNum),
    3613            0 :                                      state.dataIPShortCut->rNumericArgs(iMaxCoolAirVolFlowNumericNum)));
    3614            0 :             ErrorsFound = true;
    3615              :         } else {
    3616          808 :             SysSizInput(SysSizIndex).DesCoolAirFlow = state.dataIPShortCut->rNumericArgs(iMaxCoolAirVolFlowNumericNum);
    3617              :         }
    3618              :         //  N12;\field Heating Design Air Flow Rate
    3619              :         //      \note This input is used if Heating Design Air Flow Method is Flow/System
    3620              :         //      \note This value will *not* be multiplied by any sizing factor or by zone multipliers.
    3621              :         //      \note If using zone multipliers, this value must be large enough to serve the multiplied zones.
    3622              :         //      \type real
    3623              :         //      \units m3/s
    3624              :         //      \minimum 0
    3625              :         //      \default 0
    3626              :         // int const iHeatSAFMAlphaNum = 7; // A7, \field Heating Design Air Flow Method
    3627              :         // int const iMaxHeatAirVolFlowNumericNum = 12; // N15, \field Heating Design Air Flow Rate {m3/s}
    3628              :         // int const iHeatFlowPerFloorAreaNumericNum = 16; // N16, \field Supply Air Flow Rate Per Floor Area During Heating Operation {m3/s-m2}
    3629              :         // int const iHeatFlowPerFracHeatNumericNum = 17; // N17, \field Fraction of Autosized Design Heating Supply Air Flow Rate {-}
    3630              :         // int const iHeatFlowPerFracCoolNumericNum = 18; // N18, \field Fraction of Autosized Design Cooling Supply Air Flow Rate {-}
    3631              :         // int const iHeatFlowPerHeatCapNumericNum = 19; // N19, \field Design Supply Air Flow Rate Per Unit Heating Capacity {m3/s-W}
    3632              :         // add input fields for other cooling sizing methods
    3633          980 :         if (state.dataIPShortCut->lNumericFieldBlanks(iMaxHeatAirVolFlowNumericNum)) {
    3634          172 :             SysSizInput(SysSizIndex).DesHeatAirFlow = 0.0;
    3635          808 :         } else if (state.dataIPShortCut->rNumericArgs(iMaxHeatAirVolFlowNumericNum) < 0.0) {
    3636            0 :             ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3637            0 :             ShowContinueError(state,
    3638            0 :                               format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3639            0 :                                      state.dataIPShortCut->cNumericFieldNames(iMaxHeatAirVolFlowNumericNum),
    3640            0 :                                      state.dataIPShortCut->rNumericArgs(iMaxHeatAirVolFlowNumericNum)));
    3641            0 :             ErrorsFound = true;
    3642              :         } else {
    3643          808 :             SysSizInput(SysSizIndex).DesHeatAirFlow = state.dataIPShortCut->rNumericArgs(iMaxHeatAirVolFlowNumericNum);
    3644              :         }
    3645              :         //  N13;\field Maximum Zone Outdoor Air Fraction
    3646              :         //      \type real
    3647              :         //      \default 1.0
    3648              :         //      \minimum> 0.0
    3649              :         //      \units dimensionless
    3650              :         // int const iSystemOASMethodAlphaNum = 8; // A8,  \field System Outdoor Air Method
    3651              :         // int const iZoneMaxOAFractionNumericNum = 13; // N20, \field Zone Maximum Outdoor Air Fraction
    3652              : 
    3653              :         // add input fields for other heating sizing methods
    3654          980 :         if (state.dataIPShortCut->lNumericFieldBlanks(iZoneMaxOAFractionNumericNum)) {
    3655          179 :             SysSizInput(SysSizIndex).MaxZoneOAFraction = 0.0;
    3656          801 :         } else if (state.dataIPShortCut->rNumericArgs(iZoneMaxOAFractionNumericNum) < 0.0) {
    3657            0 :             ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3658            0 :             ShowContinueError(state,
    3659            0 :                               format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3660            0 :                                      state.dataIPShortCut->cNumericFieldNames(iZoneMaxOAFractionNumericNum),
    3661            0 :                                      state.dataIPShortCut->rNumericArgs(iZoneMaxOAFractionNumericNum)));
    3662            0 :             ErrorsFound = true;
    3663              :         } else {
    3664          801 :             SysSizInput(SysSizIndex).MaxZoneOAFraction = state.dataIPShortCut->rNumericArgs(iZoneMaxOAFractionNumericNum);
    3665              :         }
    3666              :         {
    3667          980 :             std::string const &coolAirDesMethod = state.dataIPShortCut->cAlphaArgs(iCoolSAFMAlphaNum);
    3668          980 :             if (coolAirDesMethod == "DESIGNDAY") {
    3669          975 :                 SysSizInput(SysSizIndex).CoolAirDesMethod = AirflowSizingMethod::FromDDCalc;
    3670            5 :             } else if (coolAirDesMethod == "FLOW/SYSTEM") {
    3671            4 :                 SysSizInput(SysSizIndex).CoolAirDesMethod = AirflowSizingMethod::InpDesAirFlow;
    3672            1 :             } else if (coolAirDesMethod == "FLOWPERFLOORAREA") {
    3673            0 :                 SysSizInput(SysSizIndex).CoolAirDesMethod = AirflowSizingMethod::InpDesAirFlow;
    3674            0 :                 SysSizInput(SysSizIndex).ScaleCoolSAFMethod = FlowPerFloorArea;
    3675            0 :                 SysSizInput(SysSizIndex).FlowPerFloorAreaCooled = state.dataIPShortCut->rNumericArgs(iCoolFlowPerFloorAreaNumericNum);
    3676            1 :             } else if (coolAirDesMethod == "FRACTIONOFAUTOSIZEDCOOLINGAIRFLOW") {
    3677            0 :                 SysSizInput(SysSizIndex).CoolAirDesMethod = AirflowSizingMethod::FromDDCalc;
    3678            0 :                 SysSizInput(SysSizIndex).ScaleCoolSAFMethod = FractionOfAutosizedCoolingAirflow;
    3679            0 :                 SysSizInput(SysSizIndex).FractionOfAutosizedCoolingAirflow = state.dataIPShortCut->rNumericArgs(iCoolFlowPerFracCoolNumericNum);
    3680            1 :             } else if (coolAirDesMethod == "FLOWPERCOOLINGCAPACITY") {
    3681            1 :                 SysSizInput(SysSizIndex).CoolAirDesMethod = AirflowSizingMethod::FromDDCalc;
    3682            1 :                 SysSizInput(SysSizIndex).ScaleCoolSAFMethod = FlowPerCoolingCapacity;
    3683            1 :                 SysSizInput(SysSizIndex).FlowPerCoolingCapacity = state.dataIPShortCut->rNumericArgs(iCoolFlowPerCoolCapNumericNum);
    3684              :             } else {
    3685            0 :                 ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3686            0 :                 ShowContinueError(state,
    3687            0 :                                   format("... incorrect {}=\"{}\".",
    3688            0 :                                          state.dataIPShortCut->cAlphaFieldNames(iCoolSAFMAlphaNum),
    3689            0 :                                          state.dataIPShortCut->cAlphaArgs(iCoolSAFMAlphaNum)));
    3690            0 :                 ShowContinueError(state,
    3691              :                                   "... valid values are DesignDay, Flow/System, FlowPerFloorArea, FractionOfAutosizedCoolingAirflow, or "
    3692              :                                   "FlowPerCoolingCapacity.");
    3693            0 :                 ErrorsFound = true;
    3694              :             }
    3695              :         }
    3696              :         {
    3697          980 :             std::string const &heatAirDesMethod = state.dataIPShortCut->cAlphaArgs(iHeatSAFMAlphaNum);
    3698          980 :             if (heatAirDesMethod == "DESIGNDAY") {
    3699          976 :                 SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::FromDDCalc;
    3700            4 :             } else if (heatAirDesMethod == "FLOW/SYSTEM") {
    3701            3 :                 SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::InpDesAirFlow;
    3702            1 :             } else if (heatAirDesMethod == "FLOWPERFLOORAREA") {
    3703            0 :                 SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::InpDesAirFlow;
    3704            0 :                 SysSizInput(SysSizIndex).ScaleHeatSAFMethod = FlowPerFloorArea;
    3705            0 :                 SysSizInput(SysSizIndex).FlowPerFloorAreaHeated = state.dataIPShortCut->rNumericArgs(iHeatFlowPerFloorAreaNumericNum);
    3706            1 :             } else if (heatAirDesMethod == "FRACTIONOFAUTOSIZEDHEATINGAIRFLOW") {
    3707            0 :                 SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::FromDDCalc;
    3708            0 :                 SysSizInput(SysSizIndex).ScaleHeatSAFMethod = FractionOfAutosizedHeatingAirflow;
    3709            0 :                 SysSizInput(SysSizIndex).FractionOfAutosizedHeatingAirflow = state.dataIPShortCut->rNumericArgs(iHeatFlowPerFracHeatNumericNum);
    3710            1 :             } else if (heatAirDesMethod == "FRACTIONOFAUTOSIZEDCOOLINGAIRFLOW") {
    3711            0 :                 SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::FromDDCalc;
    3712            0 :                 SysSizInput(SysSizIndex).ScaleHeatSAFMethod = FractionOfAutosizedCoolingAirflow;
    3713            0 :                 SysSizInput(SysSizIndex).FractionOfAutosizedCoolingAirflow = state.dataIPShortCut->rNumericArgs(iHeatFlowPerFracCoolNumericNum);
    3714            1 :             } else if (heatAirDesMethod == "FLOWPERHEATINGCAPACITY") {
    3715            1 :                 SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::FromDDCalc;
    3716            1 :                 SysSizInput(SysSizIndex).ScaleHeatSAFMethod = FlowPerHeatingCapacity;
    3717            1 :                 SysSizInput(SysSizIndex).FlowPerHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatFlowPerHeatCapNumericNum);
    3718              :             } else {
    3719            0 :                 ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3720            0 :                 ShowContinueError(state,
    3721            0 :                                   format("... incorrect {}=\"{}\".",
    3722            0 :                                          state.dataIPShortCut->cAlphaFieldNames(iHeatSAFMAlphaNum),
    3723            0 :                                          state.dataIPShortCut->cAlphaArgs(iHeatSAFMAlphaNum)));
    3724            0 :                 ShowContinueError(state,
    3725              :                                   "... valid values are DesignDay, Flow/System, FlowPerFloorArea, FractionOfAutosizedHeatingAirflow, or "
    3726              :                                   "FlowPerHeatingCapacity.");
    3727            0 :                 ErrorsFound = true;
    3728              :             }
    3729              :         }
    3730              :         {
    3731          980 :             std::string const &systemOAMethod = state.dataIPShortCut->cAlphaArgs(iSystemOASMethodAlphaNum);
    3732          980 :             if (systemOAMethod == "ZONESUM") {
    3733          970 :                 SysSizInput(SysSizIndex).SystemOAMethod = SysOAMethod::ZoneSum;
    3734           10 :             } else if (systemOAMethod == "STANDARD62.1VENTILATIONRATEPROCEDURE") {
    3735            7 :                 SysSizInput(SysSizIndex).SystemOAMethod = SysOAMethod::VRP;
    3736            7 :                 if (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Ventilation) {
    3737            0 :                     ShowWarningError(
    3738              :                         state,
    3739            0 :                         format("{}=\"{}\", invalid combination of inputs.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3740            0 :                     ShowContinueError(state,
    3741            0 :                                       format("{} = {} and {} = {}.",
    3742            0 :                                              state.dataIPShortCut->cAlphaFieldNames(iLoadTypeSizeAlphaNum),
    3743            0 :                                              state.dataIPShortCut->cAlphaArgs(iLoadTypeSizeAlphaNum),
    3744            0 :                                              state.dataIPShortCut->cAlphaFieldNames(iSystemOASMethodAlphaNum),
    3745            0 :                                              state.dataIPShortCut->cAlphaArgs(iSystemOASMethodAlphaNum)));
    3746            0 :                     ShowContinueError(state, "Resetting System Outdoor Air Method to ZoneSum.");
    3747            0 :                     SysSizInput(SysSizIndex).SystemOAMethod = SysOAMethod::ZoneSum;
    3748              :                 } else {
    3749            7 :                     if (SysSizInput(SysSizIndex).DesOutAirVolFlow > 0) {
    3750            0 :                         ShowSevereError(state,
    3751            0 :                                         format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3752            0 :                         ShowContinueError(state,
    3753            0 :                                           format("SystemOAMethod is set to VRP and {} > 0, user entry will be ignored.",
    3754            0 :                                                  state.dataIPShortCut->cNumericFieldNames(iDesignOAVolFlowNumericNum)));
    3755              :                     }
    3756              :                 }
    3757            3 :             } else if (systemOAMethod == "STANDARD62.1SIMPLIFIEDPROCEDURE") {
    3758            3 :                 SysSizInput(SysSizIndex).SystemOAMethod = SysOAMethod::SP;
    3759              :             } else {
    3760            0 :                 ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3761            0 :                 ShowContinueError(state,
    3762            0 :                                   format("... incorrect {}=\"{}\".",
    3763            0 :                                          state.dataIPShortCut->cAlphaFieldNames(iSystemOASMethodAlphaNum),
    3764            0 :                                          state.dataIPShortCut->cAlphaArgs(iSystemOASMethodAlphaNum)));
    3765            0 :                 ShowContinueError(state, "... valid values are ZoneSum or Standard62.1VentilationRateProcedure.");
    3766            0 :                 ErrorsFound = true;
    3767              :             }
    3768              :         }
    3769              : 
    3770              :         // Determine SysSizInput electric Cooling design capacity sizing method
    3771          980 :         if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "COOLINGDESIGNCAPACITY")) {
    3772          979 :             SysSizInput(SysSizIndex).CoolingCapMethod = CoolingDesignCapacity;
    3773              :             // SysSizInput( SysSizIndex ).ScaledCoolingCapacity = AutoSize can be set to autosize cooling capacity
    3774          979 :             SysSizInput(SysSizIndex).ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(iCoolDesignCapacityNumericNum);
    3775          979 :             if (SysSizInput(SysSizIndex).ScaledCoolingCapacity < 0.0 && SysSizInput(SysSizIndex).ScaledCoolingCapacity != AutoSize) {
    3776            0 :                 ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
    3777            0 :                 ShowContinueError(state,
    3778            0 :                                   format("Illegal {} = {:.7T}",
    3779            0 :                                          state.dataIPShortCut->cNumericFieldNames(iCoolDesignCapacityNumericNum),
    3780            0 :                                          state.dataIPShortCut->rNumericArgs(iCoolDesignCapacityNumericNum)));
    3781            0 :                 ErrorsFound = true;
    3782              :             }
    3783            1 :         } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "CAPACITYPERFLOORAREA")) {
    3784            0 :             SysSizInput(SysSizIndex).CoolingCapMethod = CapacityPerFloorArea;
    3785            0 :             if (!state.dataIPShortCut->lNumericFieldBlanks(iCoolCapacityPerFloorAreaNumericNum)) {
    3786            0 :                 SysSizInput(SysSizIndex).ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(iCoolCapacityPerFloorAreaNumericNum);
    3787            0 :                 if (SysSizInput(SysSizIndex).ScaledCoolingCapacity <= 0.0) {
    3788            0 :                     ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
    3789            0 :                     ShowContinueError(state,
    3790            0 :                                       format("Input for {} = {}",
    3791            0 :                                              state.dataIPShortCut->cAlphaFieldNames(iCoolCAPMAlphaNum),
    3792            0 :                                              state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum)));
    3793            0 :                     ShowContinueError(state,
    3794            0 :                                       format("Illegal {} = {:.7T}",
    3795            0 :                                              state.dataIPShortCut->cNumericFieldNames(iCoolCapacityPerFloorAreaNumericNum),
    3796            0 :                                              state.dataIPShortCut->rNumericArgs(iCoolCapacityPerFloorAreaNumericNum)));
    3797            0 :                     ErrorsFound = true;
    3798            0 :                 } else if (SysSizInput(SysSizIndex).ScaledCoolingCapacity == AutoSize) {
    3799            0 :                     ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
    3800            0 :                     ShowContinueError(state,
    3801            0 :                                       format("Input for {} = {}",
    3802            0 :                                              state.dataIPShortCut->cAlphaFieldNames(iCoolCAPMAlphaNum),
    3803            0 :                                              state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum)));
    3804            0 :                     ShowContinueError(state,
    3805            0 :                                       format("Illegal {} = Autosize", state.dataIPShortCut->cNumericFieldNames(iCoolCapacityPerFloorAreaNumericNum)));
    3806            0 :                     ErrorsFound = true;
    3807              :                 }
    3808              :             } else {
    3809            0 :                 ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
    3810            0 :                 ShowContinueError(state,
    3811            0 :                                   format("Input for {} = {}",
    3812            0 :                                          state.dataIPShortCut->cAlphaFieldNames(iCoolCAPMAlphaNum),
    3813            0 :                                          state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum)));
    3814            0 :                 ShowContinueError(
    3815            0 :                     state, format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iCoolCapacityPerFloorAreaNumericNum)));
    3816            0 :                 ErrorsFound = true;
    3817              :             }
    3818            1 :         } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "FRACTIONOFAUTOSIZEDCOOLINGCAPACITY")) {
    3819            1 :             SysSizInput(SysSizIndex).CoolingCapMethod = FractionOfAutosizedCoolingCapacity;
    3820            1 :             if (!state.dataIPShortCut->lNumericFieldBlanks(iCoolFracOfAutosizedCapacityNumericNum)) {
    3821            1 :                 SysSizInput(SysSizIndex).ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(iCoolFracOfAutosizedCapacityNumericNum);
    3822            1 :                 if (SysSizInput(SysSizIndex).ScaledCoolingCapacity < 0.0) {
    3823            0 :                     ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
    3824            0 :                     ShowContinueError(state,
    3825            0 :                                       format("Illegal {} = {:.7T}",
    3826            0 :                                              state.dataIPShortCut->cNumericFieldNames(iCoolFracOfAutosizedCapacityNumericNum),
    3827            0 :                                              state.dataIPShortCut->rNumericArgs(iCoolFracOfAutosizedCapacityNumericNum)));
    3828            0 :                     ErrorsFound = true;
    3829              :                 }
    3830              :             } else {
    3831            0 :                 ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
    3832            0 :                 ShowContinueError(state,
    3833            0 :                                   format("Input for {} = {}",
    3834            0 :                                          state.dataIPShortCut->cAlphaFieldNames(iCoolCAPMAlphaNum),
    3835            0 :                                          state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum)));
    3836            0 :                 ShowContinueError(
    3837              :                     state,
    3838            0 :                     format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iCoolFracOfAutosizedCapacityNumericNum)));
    3839            0 :                 ErrorsFound = true;
    3840              :             }
    3841            0 :         } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "NONE")) {
    3842            0 :             SysSizInput(SysSizIndex).CoolingCapMethod = None;
    3843            0 :             SysSizInput(SysSizIndex).ScaledCoolingCapacity = 0.0;
    3844              :         } else {
    3845            0 :             ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3846            0 :             ShowContinueError(state,
    3847            0 :                               format("... incorrect {}=\"{}\".",
    3848            0 :                                      state.dataIPShortCut->cAlphaFieldNames(iCoolCAPMAlphaNum),
    3849            0 :                                      state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum)));
    3850            0 :             ShowContinueError(state,
    3851              :                               "... valid values are CoolingDesignCapacity, CapacityPerFloorArea, FractionOfAutosizedCoolingCapacity, or None.");
    3852            0 :             ErrorsFound = true;
    3853              :         }
    3854              : 
    3855              :         // Determine SysSizInput electric heating design capacity sizing method
    3856          980 :         if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "HEATINGDESIGNCAPACITY")) {
    3857          979 :             SysSizInput(SysSizIndex).HeatingCapMethod = HeatingDesignCapacity;
    3858              :             // SysSizInput( SysSizIndex ).ScaledHeatingCapacity = AutoSize can be set to autosize heating capacity
    3859          979 :             SysSizInput(SysSizIndex).ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatDesignCapacityNumericNum);
    3860          979 :             if (SysSizInput(SysSizIndex).ScaledHeatingCapacity < 0.0 && SysSizInput(SysSizIndex).ScaledHeatingCapacity != AutoSize) {
    3861            0 :                 ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
    3862            0 :                 ShowContinueError(state,
    3863            0 :                                   format("Illegal {} = {:.7T}",
    3864            0 :                                          state.dataIPShortCut->cNumericFieldNames(iHeatDesignCapacityNumericNum),
    3865            0 :                                          state.dataIPShortCut->rNumericArgs(iHeatDesignCapacityNumericNum)));
    3866            0 :                 ErrorsFound = true;
    3867              :             }
    3868            1 :         } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "CAPACITYPERFLOORAREA")) {
    3869            0 :             SysSizInput(SysSizIndex).HeatingCapMethod = CapacityPerFloorArea;
    3870            0 :             if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatCapacityPerFloorAreaNumericNum)) {
    3871            0 :                 SysSizInput(SysSizIndex).ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatCapacityPerFloorAreaNumericNum);
    3872            0 :                 if (SysSizInput(SysSizIndex).ScaledHeatingCapacity <= 0.0) {
    3873            0 :                     ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
    3874            0 :                     ShowContinueError(state,
    3875            0 :                                       format("Input for {} = {}",
    3876            0 :                                              state.dataIPShortCut->cAlphaFieldNames(iHeatCAPMAlphaNum),
    3877            0 :                                              state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum)));
    3878            0 :                     ShowContinueError(state,
    3879            0 :                                       format("Illegal {} = {:.7T}",
    3880            0 :                                              state.dataIPShortCut->cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum),
    3881            0 :                                              state.dataIPShortCut->rNumericArgs(iHeatCapacityPerFloorAreaNumericNum)));
    3882            0 :                     ErrorsFound = true;
    3883            0 :                 } else if (SysSizInput(SysSizIndex).ScaledHeatingCapacity == AutoSize) {
    3884            0 :                     ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
    3885            0 :                     ShowContinueError(state,
    3886            0 :                                       format("Input for {} = {}",
    3887            0 :                                              state.dataIPShortCut->cAlphaFieldNames(iHeatCAPMAlphaNum),
    3888            0 :                                              state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum)));
    3889            0 :                     ShowContinueError(state,
    3890            0 :                                       format("Illegal {} = Autosize", state.dataIPShortCut->cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum)));
    3891            0 :                     ErrorsFound = true;
    3892              :                 }
    3893              :             } else {
    3894            0 :                 ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
    3895            0 :                 ShowContinueError(state,
    3896            0 :                                   format("Input for {} = {}",
    3897            0 :                                          state.dataIPShortCut->cAlphaFieldNames(iHeatCAPMAlphaNum),
    3898            0 :                                          state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum)));
    3899            0 :                 ShowContinueError(
    3900            0 :                     state, format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum)));
    3901            0 :                 ErrorsFound = true;
    3902              :             }
    3903            1 :         } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "FRACTIONOFAUTOSIZEDHEATINGCAPACITY")) {
    3904            1 :             SysSizInput(SysSizIndex).HeatingCapMethod = FractionOfAutosizedHeatingCapacity;
    3905            1 :             if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatFracOfAutosizedCapacityNumericNum)) {
    3906            1 :                 SysSizInput(SysSizIndex).ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum);
    3907            1 :                 if (SysSizInput(SysSizIndex).ScaledHeatingCapacity < 0.0) {
    3908            0 :                     ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
    3909            0 :                     ShowContinueError(state,
    3910            0 :                                       format("Illegal {} = {:.7T}",
    3911            0 :                                              state.dataIPShortCut->cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum),
    3912            0 :                                              state.dataIPShortCut->rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum)));
    3913            0 :                     ErrorsFound = true;
    3914              :                 }
    3915              :             } else {
    3916            0 :                 ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
    3917            0 :                 ShowContinueError(state,
    3918            0 :                                   format("Input for {} = {}",
    3919            0 :                                          state.dataIPShortCut->cAlphaFieldNames(iHeatCAPMAlphaNum),
    3920            0 :                                          state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum)));
    3921            0 :                 ShowContinueError(
    3922              :                     state,
    3923            0 :                     format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum)));
    3924            0 :                 ErrorsFound = true;
    3925              :             }
    3926            0 :         } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "NONE")) {
    3927            0 :             SysSizInput(SysSizIndex).HeatingCapMethod = None;
    3928            0 :             SysSizInput(SysSizIndex).ScaledHeatingCapacity = 0.0;
    3929              :         } else {
    3930            0 :             ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3931            0 :             ShowContinueError(state,
    3932            0 :                               format("... incorrect {}=\"{}\".",
    3933            0 :                                      state.dataIPShortCut->cAlphaFieldNames(iHeatCAPMAlphaNum),
    3934            0 :                                      state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum)));
    3935            0 :             ShowContinueError(state,
    3936              :                               "... valid values are HeatingDesignCapacity, CapacityPerFloorArea, FractionOfAutosizedHeatingCapacity, or None.");
    3937            0 :             ErrorsFound = true;
    3938              :         }
    3939              : 
    3940              :         //  N27; \field Occupant Diversity
    3941              :         //      \type real
    3942              :         //      \maximum 1.0
    3943              :         //      \minimum> 0.0
    3944              :         // int const  iOccupantDiversity = 27;     // N27, \field Occupant Diversity
    3945          980 :         if (state.dataIPShortCut->lNumericFieldBlanks(iOccupantDiversity)) {
    3946          975 :             SysSizInput(SysSizIndex).OccupantDiversity = AutoSize;
    3947            8 :         } else if (state.dataIPShortCut->rNumericArgs(iOccupantDiversity) <= 0.0 &&
    3948            3 :                    state.dataIPShortCut->rNumericArgs(iOccupantDiversity) != AutoSize) {
    3949            0 :             ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3950            0 :             ShowContinueError(state,
    3951            0 :                               format("... incorrect {}=[{:.2R}],  value should not be negative.",
    3952            0 :                                      state.dataIPShortCut->cNumericFieldNames(iOccupantDiversity),
    3953            0 :                                      state.dataIPShortCut->rNumericArgs(iOccupantDiversity)));
    3954            0 :             ErrorsFound = true;
    3955            5 :         } else if (state.dataIPShortCut->rNumericArgs(iOccupantDiversity) > 1.0 &&
    3956            0 :                    state.dataIPShortCut->rNumericArgs(iOccupantDiversity) != AutoSize) {
    3957            0 :             ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
    3958            0 :             ShowContinueError(state,
    3959            0 :                               format("... incorrect {}=[{:.2R}],  value should not be greater than 1.0.",
    3960            0 :                                      state.dataIPShortCut->cNumericFieldNames(iOccupantDiversity),
    3961            0 :                                      state.dataIPShortCut->rNumericArgs(iOccupantDiversity)));
    3962            0 :             ErrorsFound = true;
    3963              :         } else {
    3964            5 :             SysSizInput(SysSizIndex).OccupantDiversity = state.dataIPShortCut->rNumericArgs(iOccupantDiversity);
    3965              :         }
    3966              :     }
    3967              : 
    3968          801 :     if (ErrorsFound) {
    3969            0 :         ShowFatalError(state, format("{}: Errors found in getting input. Program terminates.", cCurrentModuleObject));
    3970              :     }
    3971          801 : }
    3972              : 
    3973          801 : void GetPlantSizingInput(EnergyPlusData &state)
    3974              : {
    3975              : 
    3976              :     // SUBROUTINE INFORMATION:
    3977              :     //       AUTHOR         Fred Buhl
    3978              :     //       DATE WRITTEN   October 2001
    3979              : 
    3980              :     // PURPOSE OF THIS SUBROUTINE:
    3981              :     // Obtains input data for Plant Sizing objects and stores it in
    3982              :     // appropriate data structures.
    3983              : 
    3984              :     // METHODOLOGY EMPLOYED:
    3985              :     // Uses InputProcessor "Get" routines to obtain data.
    3986              : 
    3987              :     // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    3988              :     int PltSizIndex;         // loop index
    3989              :     int NumAlphas;           // Number of Alphas for each GetObjectItem call
    3990              :     int NumNumbers;          // Number of Numbers for each GetObjectItem call
    3991              :     int IOStatus;            // Used in GetObjectItem
    3992          801 :     bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine
    3993          801 :     auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
    3994          801 :     cCurrentModuleObject = "Sizing:Plant";
    3995          801 :     state.dataSize->NumPltSizInput = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    3996              : 
    3997          801 :     if (state.dataSize->NumPltSizInput > 0) {
    3998          337 :         int NumDesDays = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:DesignDay") +
    3999          337 :                          state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileDays") +
    4000          337 :                          state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileConditionType");
    4001          337 :         if (NumDesDays == 0 && state.dataGlobal->DoPlantSizing) {
    4002            0 :             ShowSevereError(state, "Plant Sizing calculations need SizingPeriod:* input");
    4003            0 :             ErrorsFound = true;
    4004              :         }
    4005          337 :         state.dataSize->PlantSizData.allocate(state.dataSize->NumPltSizInput);
    4006         1150 :         for (auto &e : state.dataSize->PlantSizData) {
    4007          813 :             e.PlantLoopName.clear();
    4008          813 :             e.ExitTemp = 0.0;
    4009          813 :             e.DeltaT = 0.0;
    4010          813 :             e.LoopType = DataSizing::TypeOfPlantLoop::Invalid;
    4011          813 :             e.DesVolFlowRate = 0.0;
    4012          337 :         }
    4013         1150 :         for (int i = 1; i <= state.dataSize->NumPltSizInput; ++i) {
    4014          813 :             state.dataSize->PlantSizData(i).ConcurrenceOption = NonCoincident;
    4015          813 :             state.dataSize->PlantSizData(i).NumTimeStepsInAvg = 1;
    4016              :         }
    4017              :     }
    4018              : 
    4019         1614 :     for (PltSizIndex = 1; PltSizIndex <= state.dataSize->NumPltSizInput; ++PltSizIndex) {
    4020         1626 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    4021              :                                                                  cCurrentModuleObject,
    4022              :                                                                  PltSizIndex,
    4023          813 :                                                                  state.dataIPShortCut->cAlphaArgs,
    4024              :                                                                  NumAlphas,
    4025          813 :                                                                  state.dataIPShortCut->rNumericArgs,
    4026              :                                                                  NumNumbers,
    4027              :                                                                  IOStatus,
    4028          813 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    4029          813 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    4030          813 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    4031          813 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    4032          813 :         Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound);
    4033              : 
    4034          813 :         state.dataSize->PlantSizData(PltSizIndex).PlantLoopName = state.dataIPShortCut->cAlphaArgs(1);
    4035          813 :         state.dataSize->PlantSizData(PltSizIndex).ExitTemp = state.dataIPShortCut->rNumericArgs(1);
    4036          813 :         state.dataSize->PlantSizData(PltSizIndex).DeltaT = state.dataIPShortCut->rNumericArgs(2);
    4037          813 :         if (NumNumbers > 2) {
    4038           60 :             state.dataSize->PlantSizData(PltSizIndex).NumTimeStepsInAvg = state.dataIPShortCut->rNumericArgs(3);
    4039              :         } else {
    4040          753 :             state.dataSize->PlantSizData(PltSizIndex).NumTimeStepsInAvg = 1.0;
    4041              :         }
    4042              : 
    4043              :         constexpr static std::array<std::string_view, static_cast<int>(DataSizing::TypeOfPlantLoop::Num)> TypeOfPlantLoopNamesUC = {
    4044              :             "HEATING", "COOLING", "CONDENSER", "STEAM"};
    4045          813 :         state.dataSize->PlantSizData(PltSizIndex).LoopType =
    4046         1626 :             static_cast<TypeOfPlantLoop>(getEnumValue(TypeOfPlantLoopNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2))));
    4047          813 :         assert(state.dataSize->PlantSizData(PltSizIndex).LoopType != TypeOfPlantLoop::Invalid);
    4048              : 
    4049          813 :         if (NumAlphas > 2) {
    4050              :             {
    4051           60 :                 std::string const &concurrenceOption = state.dataIPShortCut->cAlphaArgs(3);
    4052           60 :                 if (concurrenceOption == "NONCOINCIDENT") {
    4053           16 :                     state.dataSize->PlantSizData(PltSizIndex).ConcurrenceOption = NonCoincident;
    4054           44 :                 } else if (concurrenceOption == "COINCIDENT") {
    4055           44 :                     state.dataSize->PlantSizData(PltSizIndex).ConcurrenceOption = Coincident;
    4056              :                 } else {
    4057            0 :                     ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
    4058            0 :                     ShowContinueError(
    4059            0 :                         state, format("...incorrect {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3)));
    4060            0 :                     ShowContinueError(state, R"(...Valid values are "NonCoincident" or "Coincident".)");
    4061            0 :                     ErrorsFound = true;
    4062              :                 }
    4063              :             }
    4064              :         }
    4065          813 :         if (NumAlphas > 3) {
    4066              :             {
    4067           60 :                 std::string const &sizingFactorOption = state.dataIPShortCut->cAlphaArgs(4);
    4068           60 :                 if (sizingFactorOption == "NONE") {
    4069           55 :                     state.dataSize->PlantSizData(PltSizIndex).SizingFactorOption = NoSizingFactorMode;
    4070            5 :                 } else if (sizingFactorOption == "GLOBALHEATINGSIZINGFACTOR") {
    4071            0 :                     state.dataSize->PlantSizData(PltSizIndex).SizingFactorOption = GlobalHeatingSizingFactorMode;
    4072            5 :                 } else if (sizingFactorOption == "GLOBALCOOLINGSIZINGFACTOR") {
    4073            5 :                     state.dataSize->PlantSizData(PltSizIndex).SizingFactorOption = GlobalCoolingSizingFactorMode;
    4074            0 :                 } else if (sizingFactorOption == "LOOPCOMPONENTSIZINGFACTOR") {
    4075            0 :                     state.dataSize->PlantSizData(PltSizIndex).SizingFactorOption = LoopComponentSizingFactorMode;
    4076              :                 }
    4077              :             }
    4078              :         }
    4079          813 :         SetupEMSInternalVariable(state,
    4080              :                                  "Plant Design Volume Flow Rate",
    4081          813 :                                  state.dataSize->PlantSizData(PltSizIndex).PlantLoopName,
    4082              :                                  "[m3/s]",
    4083          813 :                                  state.dataSize->PlantSizData(PltSizIndex).DesVolFlowRate);
    4084              :     }
    4085              : 
    4086          801 :     if (ErrorsFound) {
    4087            0 :         ShowFatalError(state, format("{}: Errors found in getting input. Program terminates.", cCurrentModuleObject));
    4088              :     }
    4089          801 : }
    4090              : 
    4091          428 : void SetupZoneSizing(EnergyPlusData &state, bool &ErrorsFound)
    4092              : {
    4093              : 
    4094              :     // SUBROUTINE INFORMATION:
    4095              :     //       AUTHOR         L. Lawrie/F. Buhl
    4096              :     //       DATE WRITTEN   March 2010
    4097              : 
    4098              :     // PURPOSE OF THIS SUBROUTINE:
    4099              :     //  execute a few (1) time steps of a simulation to facilitate setting up model for zone sizing
    4100              :     //  developed to resolve reverse DD problems caused be the differences
    4101              :     //  that stem from setup and information gathering that occurs during the first pass.
    4102              : 
    4103              :     // METHODOLOGY EMPLOYED:
    4104              :     // Using global flag (kickoff sizing simulation), only a few time steps are executed.
    4105              :     // global flag is used in other parts of simulation to terminate quickly.
    4106              : 
    4107          428 :     bool Available = true;
    4108              : 
    4109          428 :     state.dataSize->CurOverallSimDay = 0;
    4110         1314 :     while (Available) { // do for each environment
    4111              : 
    4112         1314 :         Weather::GetNextEnvironment(state, Available, ErrorsFound);
    4113              : 
    4114         1314 :         if (!Available) {
    4115          428 :             break;
    4116              :         }
    4117          886 :         if (ErrorsFound) {
    4118            0 :             break;
    4119              :         }
    4120              : 
    4121              :         // check that environment is one of the design days
    4122          886 :         if (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) {
    4123            0 :             continue;
    4124              :         }
    4125              : 
    4126          886 :         state.dataGlobal->BeginEnvrnFlag = true;
    4127          886 :         state.dataGlobal->EndEnvrnFlag = false;
    4128          886 :         state.dataEnvrn->EndMonthFlag = false;
    4129          886 :         state.dataGlobal->WarmupFlag = true;
    4130          886 :         state.dataGlobal->DayOfSim = 0;
    4131              : 
    4132          886 :         state.dataSize->CurEnvirNumSimDay = 1;
    4133          886 :         ++state.dataSize->CurOverallSimDay;
    4134              : 
    4135          886 :         ++state.dataGlobal->DayOfSim;
    4136          886 :         state.dataGlobal->BeginDayFlag = true;
    4137          886 :         state.dataGlobal->EndDayFlag = false;
    4138              : 
    4139          886 :         state.dataGlobal->HourOfDay = 1;
    4140              : 
    4141          886 :         state.dataGlobal->BeginHourFlag = true;
    4142          886 :         state.dataGlobal->EndHourFlag = false;
    4143              : 
    4144          886 :         state.dataGlobal->TimeStep = 1;
    4145              : 
    4146          886 :         state.dataGlobal->BeginTimeStepFlag = true;
    4147              : 
    4148          886 :         Weather::ManageWeather(state);
    4149              : 
    4150          886 :         ManageHeatBalance(state);
    4151              : 
    4152          886 :         state.dataGlobal->BeginHourFlag = false;
    4153          886 :         state.dataGlobal->BeginDayFlag = false;
    4154          886 :         state.dataGlobal->BeginEnvrnFlag = false;
    4155          886 :         state.dataGlobal->BeginSimFlag = false;
    4156              : 
    4157              :         //          ! do another timestep=1
    4158          886 :         Weather::ManageWeather(state);
    4159              : 
    4160          886 :         ManageHeatBalance(state);
    4161              : 
    4162              :         //         do an end of day, end of environment time step
    4163              : 
    4164          886 :         state.dataGlobal->HourOfDay = Constant::iHoursInDay;
    4165          886 :         state.dataGlobal->TimeStep = state.dataGlobal->TimeStepsInHour;
    4166          886 :         state.dataGlobal->EndEnvrnFlag = true;
    4167              : 
    4168          886 :         Weather::ManageWeather(state);
    4169              : 
    4170          886 :         ManageHeatBalance(state);
    4171              : 
    4172              :     } // ... End environment loop.
    4173          428 : }
    4174              : 
    4175         3679 : void reportZoneSizing(EnergyPlusData &state,
    4176              :                       DataHeatBalance::ZoneSpaceData const &zoneOrSpace,
    4177              :                       DataSizing::ZoneSizingData const &zsFinalSizing,
    4178              :                       DataSizing::ZoneSizingData const &zsCalcFinalSizing,
    4179              :                       Array2D<DataSizing::ZoneSizingData> const &zsCalcSizing,
    4180              :                       Array2D<DataSizing::ZoneSizingData> const &zSizing,
    4181              :                       bool const isSpace)
    4182              : {
    4183         3679 :     std::string_view const curName = zoneOrSpace.Name;
    4184              :     // shift for predefined reports for space vs zone
    4185         3679 :     int shift = 0;
    4186         3679 :     if (isSpace) {
    4187           14 :         shift = state.dataOutRptPredefined->pdchSpClCalcDesLd - state.dataOutRptPredefined->pdchZnClCalcDesLd;
    4188              :     }
    4189         3679 :     int thisNum = zsFinalSizing.ZoneNum; // Zone or space num
    4190         3679 :     if (zsFinalSizing.DesCoolVolFlow > 0.0) {
    4191         3637 :         int TimeStepAtPeak = zsFinalSizing.TimeStepNumAtCoolMax;
    4192         3637 :         int DDNum = zsFinalSizing.CoolDDNum;
    4193         3637 :         Real64 TempAtPeak = 0.0;
    4194         3637 :         Real64 HumRatAtPeak = 0.0;
    4195         3637 :         Real64 DOASHeatGainRateAtClPk = 0.0;
    4196         3637 :         Real64 TStatSetPtAtPk = 0.0;
    4197         3637 :         if (DDNum > 0 && TimeStepAtPeak > 0) {
    4198         3637 :             TempAtPeak = state.dataSize->DesDayWeath(DDNum).Temp(TimeStepAtPeak);
    4199         3637 :             HumRatAtPeak = state.dataSize->DesDayWeath(DDNum).HumRat(TimeStepAtPeak);
    4200         3637 :             DOASHeatGainRateAtClPk = zsCalcSizing(DDNum, thisNum).DOASHeatAddSeq(TimeStepAtPeak);
    4201         3637 :             TStatSetPtAtPk = zSizing(DDNum, thisNum).CoolTstatTempSeq(TimeStepAtPeak);
    4202              :         } else {
    4203            0 :             TempAtPeak = zsCalcFinalSizing.OutTempAtCoolPeak;
    4204            0 :             HumRatAtPeak = zsCalcFinalSizing.OutHumRatAtCoolPeak;
    4205            0 :             DOASHeatGainRateAtClPk = zsCalcFinalSizing.DOASCoolLoad;
    4206            0 :             TStatSetPtAtPk = zsCalcFinalSizing.ZoneTempAtCoolPeak;
    4207              :         }
    4208         3637 :         reportZoneSizingEio(state,
    4209         3637 :                             zsFinalSizing.ZoneName,
    4210         3637 :                             zsCalcFinalSizing.CoolSizingType,
    4211         3637 :                             zsCalcFinalSizing.DesCoolLoad,
    4212         3637 :                             zsFinalSizing.DesCoolLoad,
    4213         3637 :                             zsCalcFinalSizing.DesCoolVolFlow,
    4214         3637 :                             zsFinalSizing.DesCoolVolFlow,
    4215         3637 :                             zsFinalSizing.CoolDesDay,
    4216         3637 :                             zsCalcFinalSizing.CoolPeakDateHrMin,
    4217              :                             TempAtPeak,
    4218              :                             HumRatAtPeak,
    4219         3637 :                             zoneOrSpace.FloorArea,
    4220         3637 :                             zoneOrSpace.TotOccupants,
    4221         3637 :                             zsFinalSizing.MinOA,
    4222              :                             DOASHeatGainRateAtClPk,
    4223              :                             isSpace);
    4224         7274 :         OutputReportPredefined::PreDefTableEntry(
    4225         3637 :             state, shift + state.dataOutRptPredefined->pdchZnClCalcDesLd, curName, zsCalcFinalSizing.DesCoolLoad);
    4226         3637 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClUserDesLd, curName, zsFinalSizing.DesCoolLoad);
    4227         3637 :         if (zoneOrSpace.FloorArea != 0.0) {
    4228         7272 :             OutputReportPredefined::PreDefTableEntry(
    4229         3636 :                 state, shift + state.dataOutRptPredefined->pdchZnClUserDesLdPerArea, curName, zsFinalSizing.DesCoolLoad / zoneOrSpace.FloorArea);
    4230              :         }
    4231         3637 :         OutputReportPredefined::PreDefTableEntry(
    4232         3637 :             state, shift + state.dataOutRptPredefined->pdchZnClCalcDesAirFlow, curName, zsCalcFinalSizing.DesCoolVolFlow, 3);
    4233         3637 :         OutputReportPredefined::PreDefTableEntry(
    4234         3637 :             state, shift + state.dataOutRptPredefined->pdchZnClUserDesAirFlow, curName, zsFinalSizing.DesCoolVolFlow, 3);
    4235         3637 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClDesDay, curName, zsFinalSizing.CoolDesDay);
    4236         3637 :         OutputReportPredefined::PreDefTableEntry(
    4237         3637 :             state, shift + state.dataOutRptPredefined->pdchZnClPkTime, curName, zsCalcFinalSizing.CoolPeakDateHrMin);
    4238         3637 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkTstatTemp, curName, TStatSetPtAtPk);
    4239         7274 :         OutputReportPredefined::PreDefTableEntry(
    4240         3637 :             state, shift + state.dataOutRptPredefined->pdchZnClPkIndTemp, curName, zsCalcFinalSizing.ZoneTempAtCoolPeak);
    4241         3637 :         OutputReportPredefined::PreDefTableEntry(
    4242         3637 :             state, shift + state.dataOutRptPredefined->pdchZnClPkIndHum, curName, zsCalcFinalSizing.ZoneHumRatAtCoolPeak, 5);
    4243         3637 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOATemp, curName, TempAtPeak);
    4244         3637 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOAHum, curName, HumRatAtPeak, 5);
    4245         3637 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOAMinFlow, curName, zsFinalSizing.MinOA, 3);
    4246         3637 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkDOASHeatGain, curName, DOASHeatGainRateAtClPk);
    4247              :     } else {
    4248           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClCalcDesLd, curName, 0.0, 1);
    4249           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClUserDesLd, curName, 0.0, 1);
    4250           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClUserDesLdPerArea, curName, 0.0, 1);
    4251           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClCalcDesAirFlow, curName, 0.0, 1);
    4252           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClUserDesAirFlow, curName, 0.0, 1);
    4253           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClDesDay, curName, "N/A");
    4254           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkTime, curName, "N/A");
    4255           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkTstatTemp, curName, 0.0, 1);
    4256           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkIndTemp, curName, 0.0, 1);
    4257           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkIndHum, curName, 0.0, 1);
    4258           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOATemp, curName, 0.0, 1);
    4259           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOAHum, curName, 0.0, 1);
    4260           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOAMinFlow, curName, 0.0, 1);
    4261           42 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkDOASHeatGain, curName, 0.0, 1);
    4262              :     }
    4263         3679 :     if (zsFinalSizing.DesHeatVolFlow > 0.0) {
    4264         3662 :         int TimeStepAtPeak = zsFinalSizing.TimeStepNumAtHeatMax;
    4265         3662 :         int DDNum = zsFinalSizing.HeatDDNum;
    4266         3662 :         Real64 TempAtPeak = 0.0;
    4267         3662 :         Real64 HumRatAtPeak = 0.0;
    4268         3662 :         Real64 DOASHeatGainRateAtHtPk = 0.0;
    4269         3662 :         Real64 TStatSetPtAtPk = 0.0;
    4270         3662 :         if (DDNum > 0 && TimeStepAtPeak > 0) {
    4271         3662 :             TempAtPeak = state.dataSize->DesDayWeath(DDNum).Temp(TimeStepAtPeak);
    4272         3662 :             HumRatAtPeak = state.dataSize->DesDayWeath(DDNum).HumRat(TimeStepAtPeak);
    4273         3662 :             DOASHeatGainRateAtHtPk = zsCalcSizing(DDNum, thisNum).DOASHeatAddSeq(TimeStepAtPeak);
    4274         3662 :             TStatSetPtAtPk = zSizing(DDNum, thisNum).HeatTstatTempSeq(TimeStepAtPeak);
    4275              :         } else {
    4276            0 :             TempAtPeak = zsCalcFinalSizing.OutTempAtHeatPeak;
    4277            0 :             HumRatAtPeak = zsCalcFinalSizing.OutHumRatAtHeatPeak;
    4278            0 :             DOASHeatGainRateAtHtPk = zsCalcFinalSizing.DOASHeatLoad;
    4279            0 :             TStatSetPtAtPk = zsCalcFinalSizing.ZoneTempAtHeatPeak;
    4280              :         }
    4281         3662 :         reportZoneSizingEio(state,
    4282         3662 :                             zsFinalSizing.ZoneName,
    4283         3662 :                             zsCalcFinalSizing.HeatSizingType,
    4284         3662 :                             zsCalcFinalSizing.DesHeatLoad,
    4285         3662 :                             zsFinalSizing.DesHeatLoad,
    4286         3662 :                             zsCalcFinalSizing.DesHeatVolFlow,
    4287         3662 :                             zsFinalSizing.DesHeatVolFlow,
    4288         3662 :                             zsFinalSizing.HeatDesDay,
    4289         3662 :                             zsCalcFinalSizing.HeatPeakDateHrMin,
    4290              :                             TempAtPeak,
    4291              :                             HumRatAtPeak,
    4292         3662 :                             zoneOrSpace.FloorArea,
    4293         3662 :                             zoneOrSpace.TotOccupants,
    4294         3662 :                             zsFinalSizing.MinOA,
    4295              :                             DOASHeatGainRateAtHtPk,
    4296              :                             isSpace);
    4297         7324 :         OutputReportPredefined::PreDefTableEntry(
    4298         3662 :             state, shift + state.dataOutRptPredefined->pdchZnHtCalcDesLd, curName, zsCalcFinalSizing.DesHeatLoad);
    4299         3662 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtUserDesLd, curName, zsFinalSizing.DesHeatLoad);
    4300         3662 :         if (zoneOrSpace.FloorArea != 0.0) {
    4301         7322 :             OutputReportPredefined::PreDefTableEntry(
    4302         3661 :                 state, shift + state.dataOutRptPredefined->pdchZnHtUserDesLdPerArea, curName, zsFinalSizing.DesHeatLoad / zoneOrSpace.FloorArea);
    4303              :         }
    4304         3662 :         OutputReportPredefined::PreDefTableEntry(
    4305         3662 :             state, shift + state.dataOutRptPredefined->pdchZnHtCalcDesAirFlow, curName, zsCalcFinalSizing.DesHeatVolFlow, 3);
    4306         3662 :         OutputReportPredefined::PreDefTableEntry(
    4307         3662 :             state, shift + state.dataOutRptPredefined->pdchZnHtUserDesAirFlow, curName, zsFinalSizing.DesHeatVolFlow, 3);
    4308         3662 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtDesDay, curName, zsFinalSizing.HeatDesDay);
    4309         3662 :         OutputReportPredefined::PreDefTableEntry(
    4310         3662 :             state, shift + state.dataOutRptPredefined->pdchZnHtPkTime, curName, zsCalcFinalSizing.HeatPeakDateHrMin);
    4311         3662 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkTstatTemp, curName, TStatSetPtAtPk);
    4312         7324 :         OutputReportPredefined::PreDefTableEntry(
    4313         3662 :             state, shift + state.dataOutRptPredefined->pdchZnHtPkIndTemp, curName, zsCalcFinalSizing.ZoneTempAtHeatPeak);
    4314         3662 :         OutputReportPredefined::PreDefTableEntry(
    4315         3662 :             state, shift + state.dataOutRptPredefined->pdchZnHtPkIndHum, curName, zsCalcFinalSizing.ZoneHumRatAtHeatPeak, 5);
    4316         3662 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOATemp, curName, TempAtPeak);
    4317         3662 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOAHum, curName, HumRatAtPeak, 5);
    4318         3662 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOAMinFlow, curName, zsFinalSizing.MinOA, 3);
    4319         3662 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkDOASHeatGain, curName, DOASHeatGainRateAtHtPk);
    4320              :     } else {
    4321           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtCalcDesLd, curName, 0.0, 1);
    4322           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtUserDesLd, curName, 0.0, 1);
    4323           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtUserDesLdPerArea, curName, 0.0, 1);
    4324           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtCalcDesAirFlow, curName, 0.0, 1);
    4325           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtUserDesAirFlow, curName, 0.0, 1);
    4326           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtDesDay, curName, "N/A");
    4327           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkTime, curName, "N/A");
    4328           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkTstatTemp, curName, 0.0, 1);
    4329           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkIndTemp, curName, 0.0, 1);
    4330           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkIndHum, curName, 0.0, 1);
    4331           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOATemp, curName, 0.0, 1);
    4332           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOAHum, curName, 0.0, 1);
    4333           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOAMinFlow, curName, 0.0, 1);
    4334           17 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkDOASHeatGain, curName, 0.0, 1);
    4335              :     }
    4336         3679 : }
    4337         7299 : void reportZoneSizingEio(EnergyPlusData &state,
    4338              :                          std::string const &ZoneName,   // the name of the zone
    4339              :                          std::string const &LoadType,   // the description of the input variable
    4340              :                          Real64 const CalcDesLoad,      // the value from the sizing calculation [W]
    4341              :                          Real64 const UserDesLoad,      // the value from the sizing calculation modified by user input [W]
    4342              :                          Real64 const CalcDesFlow,      // calculated design air flow rate [m3/s]
    4343              :                          Real64 const UserDesFlow,      // user input or modified design air flow rate [m3/s]
    4344              :                          std::string const &DesDayName, // the name of the design day that produced the peak
    4345              :                          std::string const &PeakHrMin,  // time stamp of the peak
    4346              :                          Real64 const PeakTemp,         // temperature at peak [C]
    4347              :                          Real64 const PeakHumRat,       // humidity ratio at peak [kg water/kg dry air]
    4348              :                          Real64 const FloorArea,        // zone floor area [m2]
    4349              :                          Real64 const TotOccs,          // design number of occupants for the zone
    4350              :                          Real64 const MinOAVolFlow,     // zone design minimum outside air flow rate [m3/s]
    4351              :                          Real64 const DOASHeatAddRate,  // zone design heat addition rate from the DOAS [W]
    4352              :                          bool const isSpace)
    4353              : {
    4354              : 
    4355              :     // SUBROUTINE INFORMATION:
    4356              :     //       AUTHOR         Fred Buhl
    4357              :     //       DATE WRITTEN   December 2001
    4358              :     //       MODIFIED       August 2008, Greg Stark
    4359              : 
    4360              :     // PURPOSE OF THIS SUBROUTINE:
    4361              :     // This subroutine writes one item of zone sizing data to the "eio" file..
    4362              : 
    4363         7299 :     if (state.dataSizingManager->ReportZoneSizingMyOneTimeFlag && !isSpace) {
    4364              :         static constexpr std::string_view Format_990_Zone(
    4365              :             "! <Zone Sizing Information>, Zone Name, Load Type, Calc Des Load {W}, User Des Load {W}, Calc Des Air Flow "
    4366              :             "Rate {m3/s}, User Des Air Flow Rate {m3/s}, Design Day Name, Date/Time of Peak, Temperature at Peak {C}, "
    4367              :             "Humidity Ratio at Peak {kgWater/kgDryAir}, Floor Area {m2}, # Occupants, Calc Outdoor Air Flow Rate {m3/s}, "
    4368              :             "Calc DOAS Heat Addition Rate {W}");
    4369          427 :         print(state.files.eio, "{}\n", Format_990_Zone);
    4370          427 :         state.dataSizingManager->ReportZoneSizingMyOneTimeFlag = false;
    4371              :     }
    4372         7299 :     if (state.dataSizingManager->ReportSpaceSizingMyOneTimeFlag && isSpace) {
    4373              :         static constexpr std::string_view Format_990_Space(
    4374              :             "! <Space Sizing Information>, Space Name, Load Type, Calc Des Load {W}, User Des Load {W}, Calc Des Air Flow "
    4375              :             "Rate {m3/s}, User Des Air Flow Rate {m3/s}, Design Day Name, Date/Time of Peak, Temperature at Peak {C}, "
    4376              :             "Humidity Ratio at Peak {kgWater/kgDryAir}, Floor Area {m2}, # Occupants, Calc Outdoor Air Flow Rate {m3/s}, "
    4377              :             "Calc DOAS Heat Addition Rate {W}");
    4378            2 :         print(state.files.eio, "{}\n", Format_990_Space);
    4379            2 :         state.dataSizingManager->ReportSpaceSizingMyOneTimeFlag = false;
    4380              :     }
    4381              : 
    4382              :     static constexpr std::string_view Format_991_Space(
    4383              :         " Space Sizing Information, {}, {}, {:.5R}, {:.5R}, {:.5R}, {:.5R}, {}, {}, {:.5R}, {:.5R}, {:.5R}, {:.5R}, {:.5R}, {:.5R}\n");
    4384              :     static constexpr std::string_view Format_991_Zone(
    4385              :         " Zone Sizing Information, {}, {}, {:.5R}, {:.5R}, {:.5R}, {:.5R}, {}, {}, {:.5R}, {:.5R}, {:.5R}, {:.5R}, {:.5R}, {:.5R}\n");
    4386         7299 :     if (isSpace) {
    4387           28 :         print(state.files.eio,
    4388              :               Format_991_Space,
    4389              :               ZoneName,
    4390              :               LoadType,
    4391              :               CalcDesLoad,
    4392              :               UserDesLoad,
    4393              :               CalcDesFlow,
    4394              :               UserDesFlow,
    4395              :               DesDayName,
    4396              :               PeakHrMin,
    4397              :               PeakTemp,
    4398              :               PeakHumRat,
    4399              :               FloorArea,
    4400              :               TotOccs,
    4401              :               MinOAVolFlow,
    4402              :               DOASHeatAddRate);
    4403              :     } else {
    4404         7271 :         print(state.files.eio,
    4405              :               Format_991_Zone,
    4406              :               ZoneName,
    4407              :               LoadType,
    4408              :               CalcDesLoad,
    4409              :               UserDesLoad,
    4410              :               CalcDesFlow,
    4411              :               UserDesFlow,
    4412              :               DesDayName,
    4413              :               PeakHrMin,
    4414              :               PeakTemp,
    4415              :               PeakHumRat,
    4416              :               FloorArea,
    4417              :               TotOccs,
    4418              :               MinOAVolFlow,
    4419              :               DOASHeatAddRate);
    4420              :     }
    4421              : 
    4422              :     // BSLLC Start
    4423         7299 :     if (state.dataSQLiteProcedures->sqlite) {
    4424         2504 :         state.dataSQLiteProcedures->sqlite->addSQLiteZoneSizingRecord(ZoneName,
    4425              :                                                                       LoadType,
    4426              :                                                                       CalcDesLoad,
    4427              :                                                                       UserDesLoad,
    4428              :                                                                       CalcDesFlow,
    4429              :                                                                       UserDesFlow,
    4430              :                                                                       DesDayName,
    4431              :                                                                       PeakHrMin,
    4432              :                                                                       PeakTemp,
    4433              :                                                                       PeakHumRat,
    4434              :                                                                       MinOAVolFlow,
    4435              :                                                                       DOASHeatAddRate);
    4436              :     }
    4437              :     // BSLLC Finish
    4438         7299 : }
    4439              : 
    4440              : // Writes system sizing data to EIO file using one row per system
    4441         1938 : void ReportSysSizing(EnergyPlusData &state,
    4442              :                      std::string const &SysName,    // the name of the zone
    4443              :                      std::string_view LoadType,     // either "Cooling" or "Heating"
    4444              :                      std::string_view PeakLoadKind, // either "Sensible" or "Total"
    4445              :                      Real64 const UserDesCap,       // User  Design Capacity
    4446              :                      Real64 const CalcDesVolFlow,   // Calculated  Design Air Flow Rate
    4447              :                      Real64 const UserDesVolFlow,   // User Design Air Flow Rate
    4448              :                      std::string const &DesDayName, // the name of the design day that produced the peak
    4449              :                      std::string const &DesDayDate, // the date that produced the peak
    4450              :                      int const TimeStepIndex        // time step of the peak
    4451              : )
    4452              : {
    4453              : 
    4454         1938 :     if (state.dataSizingManager->ReportSysSizingMyOneTimeFlag) {
    4455          347 :         print(state.files.eio,
    4456              :               "{}\n",
    4457              :               "! <System Sizing Information>, System Name, Load Type, Peak Load Kind, User Design Capacity [W], Calc Des Air "
    4458              :               "Flow Rate [m3/s], User Des Air Flow Rate [m3/s], Design Day Name, Date/Time of Peak");
    4459          347 :         state.dataSizingManager->ReportSysSizingMyOneTimeFlag = false;
    4460              :     }
    4461         1938 :     std::string dateHrMin = DesDayDate + " " + TimeIndexToHrMinString(state, TimeStepIndex);
    4462         1938 :     print(state.files.eio,
    4463              :           " System Sizing Information, {}, {}, {}, {:.2R}, {:.5R}, {:.5R}, {}, {}\n",
    4464              :           SysName,
    4465              :           LoadType,
    4466              :           PeakLoadKind,
    4467              :           UserDesCap,
    4468              :           CalcDesVolFlow,
    4469              :           UserDesVolFlow,
    4470              :           DesDayName,
    4471              :           dateHrMin);
    4472              : 
    4473              :     // BSLLC Start
    4474         1938 :     if (state.dataSQLiteProcedures->sqlite) {
    4475          542 :         state.dataSQLiteProcedures->sqlite->addSQLiteSystemSizingRecord(
    4476              :             SysName, LoadType, PeakLoadKind, UserDesCap, CalcDesVolFlow, UserDesVolFlow, DesDayName, dateHrMin);
    4477              :     }
    4478              :     // BSLLC Finish
    4479         1938 : }
    4480              : 
    4481              : // convert an index for the timestep of the day into a hour minute string in the format 00:00
    4482         1938 : std::string TimeIndexToHrMinString(EnergyPlusData const &state, int timeIndex)
    4483              : {
    4484         1938 :     int tMinOfDay = timeIndex * state.dataGlobal->MinutesInTimeStep;
    4485         1938 :     int tHr = int(tMinOfDay / 60.);
    4486         1938 :     int tMin = tMinOfDay - tHr * 60;
    4487         3876 :     return format(PeakHrMinFmt, tHr, tMin);
    4488              : }
    4489              : 
    4490          801 : void GetZoneHVACSizing(EnergyPlusData &state)
    4491              : {
    4492              :     // SUBROUTINE INFORMATION:
    4493              :     //       AUTHOR         B. Nigusse - FSEC
    4494              :     //       DATE WRITTEN   July 2014
    4495              : 
    4496              :     // PURPOSE OF THIS SUBROUTINE:
    4497              :     // Obtains input data for the ZoneHVAC sizing methods object and stores it in
    4498              :     // appropriate data structure.
    4499              : 
    4500              :     // METHODOLOGY EMPLOYED:
    4501              :     // Uses InputProcessor "Get" routines to obtain data.
    4502              :     // This object requires only a name where the default values are assumed
    4503              :     // if subsequent fields are not entered.
    4504              : 
    4505              :     // SUBROUTINE PARAMETER DEFINITIONS:
    4506              :     static constexpr std::string_view RoutineName("GetZoneHVACSizing: "); // include trailing blank space
    4507              : 
    4508              :     // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    4509              : 
    4510              :     int iHeatSAFMAlphaNum;                     // get input index to Zone HVAC sizing heat supp air flow method
    4511              :     int iCoolSAFMAlphaNum;                     // get input index to Zone HVAC sizing cool supp air flow method
    4512              :     int iMaxCoolAirVolFlowNumericNum;          // get input index to Zone HVAC sizing cool supply air flow
    4513              :     int iMaxHeatAirVolFlowNumericNum;          // get input index to Zone HVAC sizing heat supply air flow
    4514              :     int iNoCoolHeatSAFMAlphaNum;               // get input index to Zone HVAC sizing no cool/heat supply air flow
    4515              :     int iMaxNoCoolHeatAirVolFlowNumericNum;    // get input index to Zone HVAC sizing no cool/heat supply air flow
    4516              :     int iCoolFlowPerFloorAreaNumericNum;       // get input index to Zone HVAC sizing cool flow per floor area
    4517              :     int iCoolFlowPerFracCoolNumericNum;        // get input index to Zone HVAC sizing cool flow per fraction cool
    4518              :     int iCoolFlowPerCoolCapNumericNum;         // get input index to Zone HVAC sizing cool flow per cooling cap
    4519              :     int iHeatFlowPerFloorAreaNumericNum;       // get input index to Zone HVAC sizing heat flow per floor area
    4520              :     int iHeatFlowPerFracCoolNumericNum;        // get input index to Zone HVAC sizing heat flow per fraction heat
    4521              :     int iHeatFlowPerHeatCapNumericNum;         // get input index to Zone HVAC sizing heat flow per heating cap
    4522              :     int iNoCoolHeatFlowPerFloorAreaNumericNum; // get input index to Zone HVAC sizing no cool/heat FPA
    4523              :     int iNoCoolHeatFlowPerFracCoolNumericNum;  // get input index to Zone HVAC sizing no cool/heat FPFC
    4524              :     int iNoCoolHeatFlowPerFracHeatNumericNum;  // get input index to Zone HVAC sizing no cool/heat FPFH
    4525              : 
    4526              :     int iCoolCAPMAlphaNum;                      // get input index to Zone HVAC sizing chilled water flow method
    4527              :     int iCoolDesignCapacityNumericNum;          // get input index to Zone HVAC sizing chilled water flow
    4528              :     int iCoolCapacityPerFloorAreaNumericNum;    // get input index to Zone HVAC sizing cooling capacity per floor area
    4529              :     int iCoolFracOfAutosizedCapacityNumericNum; // get input index to Zone HVAC sizing capacity as fraction autosized cooling capacity
    4530              : 
    4531              :     int iHeatCAPMAlphaNum;                      // get input index to Zone HVAC sizing heating capacity
    4532              :     int iHeatDesignCapacityNumericNum;          // get input index to Zone HVAC sizing heating design capacity
    4533              :     int iHeatCapacityPerFloorAreaNumericNum;    // get input index to Zone HVAC sizing heating capacity per floor area
    4534              :     int iHeatFracOfAutosizedCapacityNumericNum; // get input index to Zone HVAC sizing capacity as fraction autosized cooling capacity
    4535              : 
    4536          801 :     iCoolSAFMAlphaNum = 2;               // get input index to Zone HVAC sizing heat supp air flow method
    4537          801 :     iMaxCoolAirVolFlowNumericNum = 1;    // get input index to Zone HVAC sizing cool supply air flow
    4538          801 :     iCoolFlowPerFloorAreaNumericNum = 2; // get input index to Zone HVAC sizing cool flow per floor area
    4539          801 :     iCoolFlowPerFracCoolNumericNum = 3;  // get input index to Zone HVAC sizing cool flow per fraction cool
    4540          801 :     iCoolFlowPerCoolCapNumericNum = 4;   // get input index to Zone HVAC sizing cool flow per cooling cap
    4541              : 
    4542          801 :     iNoCoolHeatSAFMAlphaNum = 3;               // get input index to Zone HVAC sizing no cool/heat supply air flow
    4543          801 :     iMaxNoCoolHeatAirVolFlowNumericNum = 5;    // get input index to Zone HVAC sizing no cool/heat supply air flow
    4544          801 :     iNoCoolHeatFlowPerFloorAreaNumericNum = 6; // get input index to Zone HVAC sizing no cool/heat FPA
    4545          801 :     iNoCoolHeatFlowPerFracCoolNumericNum = 7;  // get input index to Zone HVAC sizing no cool/heat FPFC
    4546          801 :     iNoCoolHeatFlowPerFracHeatNumericNum = 8;  // get input index to Zone HVAC sizing no cool/heat FPFH
    4547              : 
    4548          801 :     iHeatSAFMAlphaNum = 4;                // get input index to Zone HVAC sizing cool supp air flow method
    4549          801 :     iMaxHeatAirVolFlowNumericNum = 9;     // get input index to Zone HVAC sizing heat supply air flow
    4550          801 :     iHeatFlowPerFloorAreaNumericNum = 10; // get input index to Zone HVAC sizing heat flow per floor area
    4551          801 :     iHeatFlowPerFracCoolNumericNum = 11;  // get input index to Zone HVAC sizing heat flow per fraction heat
    4552          801 :     iHeatFlowPerHeatCapNumericNum = 12;   // get input index to Zone HVAC sizing heat flow per heating cap
    4553              : 
    4554          801 :     iCoolCAPMAlphaNum = 5;                       // get input index to Zone HVAC sizing cooling design capacity method
    4555          801 :     iCoolDesignCapacityNumericNum = 13;          // get input index to Zone HVAC sizing cooling design capacity
    4556          801 :     iCoolCapacityPerFloorAreaNumericNum = 14;    // get input index to Zone HVAC sizing cooling design capacity per floor area
    4557          801 :     iCoolFracOfAutosizedCapacityNumericNum = 15; // get input index to Zone HVAC sizing as a fraction of cooling design capacity
    4558              : 
    4559          801 :     iHeatCAPMAlphaNum = 6;                       // get input index to Zone HVAC sizing heating capacity
    4560          801 :     iHeatDesignCapacityNumericNum = 16;          // get input index to Zone HVAC sizing heating design capacity
    4561          801 :     iHeatCapacityPerFloorAreaNumericNum = 17;    // get input index to Zone HVAC sizing heating capacity per floor area
    4562          801 :     iHeatFracOfAutosizedCapacityNumericNum = 18; // get input index to Zone HVAC sizing capacity as fraction autosized heating capacity
    4563              : 
    4564              :     int NumAlphas;           // Number of Alphas for each GetObjectItem call
    4565              :     int NumNumbers;          // Number of Numbers for each GetObjectItem call
    4566              :     int TotalArgs;           // Total number of alpha and numeric arguments (max) for a
    4567          801 :     bool ErrorsFound(false); // If errors detected in input
    4568              :     //  REAL(r64) :: CalcAmt
    4569              : 
    4570          801 :     std::string CurrentModuleObject; // for ease in getting objects
    4571          801 :     Array1D_string Alphas;           // Alpha input items for object
    4572          801 :     Array1D_string cAlphaFields;     // Alpha field names
    4573          801 :     Array1D_string cNumericFields;   // Numeric field names
    4574          801 :     Array1D<Real64> Numbers;         // Numeric input items for object
    4575          801 :     Array1D_bool lAlphaBlanks;       // Logical array, alpha field input BLANK = .TRUE.
    4576          801 :     Array1D_bool lNumericBlanks;     // Logical array, numeric field input BLANK = .TRUE.
    4577              : 
    4578          801 :     CurrentModuleObject = "DesignSpecification:ZoneHVAC:Sizing";
    4579          801 :     state.dataSize->NumZoneHVACSizing = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
    4580          801 :     state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, TotalArgs, NumAlphas, NumNumbers);
    4581              : 
    4582          801 :     Alphas.allocate(NumAlphas);
    4583          801 :     cAlphaFields.allocate(NumAlphas);
    4584          801 :     cNumericFields.allocate(NumNumbers);
    4585          801 :     Numbers.dimension(NumNumbers, 0.0);
    4586          801 :     lAlphaBlanks.dimension(NumAlphas, true);
    4587          801 :     lNumericBlanks.dimension(NumNumbers, true);
    4588              : 
    4589          801 :     if (state.dataSize->NumZoneHVACSizing > 0) {
    4590              :         int IOStatus; // Used in GetObjectItem
    4591            2 :         state.dataSize->ZoneHVACSizing.allocate(state.dataSize->NumZoneHVACSizing);
    4592              : 
    4593              :         // Start Loading the System Input
    4594            6 :         for (int zSIndex = 1; zSIndex <= state.dataSize->NumZoneHVACSizing; ++zSIndex) {
    4595              : 
    4596            8 :             Alphas = "";
    4597            8 :             cAlphaFields = "";
    4598            4 :             cNumericFields = "";
    4599            4 :             Numbers = 0;
    4600            4 :             lAlphaBlanks = true;
    4601            4 :             lNumericBlanks = true;
    4602              : 
    4603            4 :             state.dataInputProcessing->inputProcessor->getObjectItem(state,
    4604              :                                                                      CurrentModuleObject,
    4605              :                                                                      zSIndex,
    4606              :                                                                      Alphas,
    4607              :                                                                      NumAlphas,
    4608              :                                                                      Numbers,
    4609              :                                                                      NumNumbers,
    4610              :                                                                      IOStatus,
    4611              :                                                                      lNumericBlanks,
    4612              :                                                                      lAlphaBlanks,
    4613              :                                                                      cAlphaFields,
    4614              :                                                                      cNumericFields);
    4615            4 :             Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound);
    4616              : 
    4617            4 :             state.dataSize->ZoneHVACSizing(zSIndex).Name = Alphas(1);
    4618              : 
    4619              :             // Determine supply air flow rate sizing method for cooling mode
    4620            4 :             if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "SupplyAirFlowRate")) {
    4621            2 :                 state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = SupplyAirFlowRate;
    4622              : 
    4623            2 :                 if (!lNumericBlanks(iMaxCoolAirVolFlowNumericNum)) {
    4624            2 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = Numbers(iMaxCoolAirVolFlowNumericNum);
    4625            2 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow == AutoSize) {
    4626            2 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4627              :                     }
    4628            4 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow <= 0.0 &&
    4629            2 :                         state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow != AutoSize) {
    4630            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4631            0 :                         ShowContinueError(
    4632              :                             state,
    4633            0 :                             format("Illegal {} = {:.7T}", cNumericFields(iMaxCoolAirVolFlowNumericNum), Numbers(iMaxCoolAirVolFlowNumericNum)));
    4634            0 :                         ErrorsFound = true;
    4635              :                     }
    4636              :                 } else {
    4637            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4638            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
    4639            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iMaxCoolAirVolFlowNumericNum)));
    4640            0 :                     ErrorsFound = true;
    4641              :                 }
    4642            2 :             } else if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "FlowPerFloorArea")) {
    4643            1 :                 state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = FlowPerFloorArea;
    4644            1 :                 if (!lNumericBlanks(iCoolFlowPerFloorAreaNumericNum)) {
    4645            1 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = Numbers(iCoolFlowPerFloorAreaNumericNum);
    4646            1 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow <= 0.0 &&
    4647            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow != AutoSize) {
    4648            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4649            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
    4650            0 :                         ShowContinueError(
    4651              :                             state,
    4652            0 :                             format("Illegal {} = {:.7T}", cNumericFields(iCoolFlowPerFloorAreaNumericNum), Numbers(iCoolFlowPerFloorAreaNumericNum)));
    4653            0 :                         ErrorsFound = true;
    4654              :                         // Autosized input is not allowed
    4655            1 :                     } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow == AutoSize) {
    4656            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4657            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
    4658            0 :                         ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iCoolFlowPerFloorAreaNumericNum)));
    4659            0 :                         ErrorsFound = true;
    4660              :                     } else {
    4661              :                         // user input cooling supply air flow per unit conditioned area is saved in ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow
    4662            1 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4663              :                     }
    4664              :                 } else {
    4665            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4666            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
    4667            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolFlowPerFloorAreaNumericNum)));
    4668            0 :                     ErrorsFound = true;
    4669              :                 }
    4670            1 :             } else if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "FractionOfAutosizedCoolingAirflow")) {
    4671            1 :                 state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = FractionOfAutosizedCoolingAirflow;
    4672            1 :                 if (!lNumericBlanks(iCoolFlowPerFracCoolNumericNum)) {
    4673            1 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = Numbers(iCoolFlowPerFracCoolNumericNum);
    4674            1 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow <= 0.0 &&
    4675            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow != AutoSize) {
    4676            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4677            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
    4678            0 :                         ShowContinueError(
    4679              :                             state,
    4680            0 :                             format("Illegal {} = {:.7T}", cNumericFields(iCoolFlowPerFracCoolNumericNum), Numbers(iCoolFlowPerFracCoolNumericNum)));
    4681            0 :                         ErrorsFound = true;
    4682              :                         // Autosized input is not allowed
    4683            1 :                     } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow == AutoSize) {
    4684            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4685            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
    4686            0 :                         ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iCoolFlowPerFracCoolNumericNum)));
    4687            0 :                         ErrorsFound = true;
    4688              :                     } else {
    4689              :                         // user input fraction of cooling supply air flow rate is saved in ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow
    4690            1 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4691              :                     }
    4692              :                 } else {
    4693            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4694            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
    4695            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolFlowPerFracCoolNumericNum)));
    4696            0 :                     ErrorsFound = true;
    4697              :                 }
    4698            0 :             } else if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "FlowPerCoolingCapacity")) {
    4699              : 
    4700            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = FlowPerCoolingCapacity;
    4701            0 :                 if (!lNumericBlanks(iCoolFlowPerCoolCapNumericNum)) {
    4702            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = Numbers(iCoolFlowPerCoolCapNumericNum);
    4703            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow <= 0.0 &&
    4704            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow != AutoSize) {
    4705            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4706            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
    4707            0 :                         ShowContinueError(
    4708              :                             state,
    4709            0 :                             format("Illegal {} = {:.7T}", cNumericFields(iCoolFlowPerCoolCapNumericNum), Numbers(iCoolFlowPerCoolCapNumericNum)));
    4710            0 :                         ErrorsFound = true;
    4711              :                         // Autosized input is not allowed
    4712            0 :                     } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow == AutoSize) {
    4713            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4714            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
    4715            0 :                         ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iCoolFlowPerCoolCapNumericNum)));
    4716            0 :                         ErrorsFound = true;
    4717              :                     } else {
    4718              :                         // user input cooling supply air flow per unit cooling capacity is saved in ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow
    4719            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4720              :                     }
    4721              :                 } else {
    4722            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4723            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
    4724            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolFlowPerCoolCapNumericNum)));
    4725            0 :                     ErrorsFound = true;
    4726              :                 }
    4727            0 :             } else if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "None") || lAlphaBlanks(iCoolSAFMAlphaNum)) {
    4728            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = None;
    4729            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = 0.0;
    4730              :                 // cooling supply air flow rate will not be sized, may be cooling coil does not exist
    4731              :             } else {
    4732            0 :                 ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4733            0 :                 ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
    4734            0 :                 ErrorsFound = true;
    4735              :             }
    4736              :             // Determine supply air flow rate sizing method for heating mode
    4737            4 :             if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "SupplyAirFlowRate")) {
    4738            2 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = SupplyAirFlowRate;
    4739            2 :                 if (!lNumericBlanks(iMaxHeatAirVolFlowNumericNum)) {
    4740            2 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iMaxHeatAirVolFlowNumericNum);
    4741            2 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow == AutoSize) {
    4742            2 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4743              :                     }
    4744              : 
    4745            4 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow <= 0.0 &&
    4746            2 :                         state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow != AutoSize) {
    4747            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4748            0 :                         ShowContinueError(
    4749              :                             state,
    4750            0 :                             format("Illegal {} = {:.7T}", cNumericFields(iMaxHeatAirVolFlowNumericNum), Numbers(iMaxHeatAirVolFlowNumericNum)));
    4751            0 :                         ErrorsFound = true;
    4752              :                     }
    4753              :                 } else {
    4754            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4755            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
    4756            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iMaxHeatAirVolFlowNumericNum)));
    4757            0 :                     ErrorsFound = true;
    4758              :                 }
    4759            2 :             } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "FlowPerFloorArea")) {
    4760            1 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = FlowPerFloorArea;
    4761            1 :                 if (!lNumericBlanks(iHeatFlowPerFloorAreaNumericNum)) {
    4762            1 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iHeatFlowPerFloorAreaNumericNum);
    4763            1 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow <= 0.0 &&
    4764            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow != AutoSize) {
    4765            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4766            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
    4767            0 :                         ShowContinueError(
    4768              :                             state,
    4769            0 :                             format("Illegal {} = {:.7T}", cNumericFields(iHeatFlowPerFloorAreaNumericNum), Numbers(iHeatFlowPerFloorAreaNumericNum)));
    4770            0 :                         ErrorsFound = true;
    4771              :                         // Autosized input is not allowed
    4772            1 :                     } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow == AutoSize) {
    4773            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4774            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
    4775            0 :                         ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iHeatFlowPerFloorAreaNumericNum)));
    4776            0 :                         ErrorsFound = true;
    4777              :                     } else {
    4778              :                         // user input heating supply air flow per unit conditioned area is saved in ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow
    4779            1 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4780              :                     }
    4781              :                 } else {
    4782            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4783            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
    4784            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatFlowPerFloorAreaNumericNum)));
    4785            0 :                     ErrorsFound = true;
    4786              :                 }
    4787            1 :             } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "FractionOfAutosizedHeatingAirflow")) {
    4788            1 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = FractionOfAutosizedHeatingAirflow;
    4789            1 :                 if (!lNumericBlanks(iHeatFlowPerFracCoolNumericNum)) {
    4790            1 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iHeatFlowPerFracCoolNumericNum);
    4791            1 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow <= 0.0 &&
    4792            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow != AutoSize) {
    4793            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4794            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
    4795            0 :                         ShowContinueError(
    4796              :                             state,
    4797            0 :                             format("Illegal {} = {:.7T}", cNumericFields(iHeatFlowPerFracCoolNumericNum), Numbers(iHeatFlowPerFracCoolNumericNum)));
    4798            0 :                         ErrorsFound = true;
    4799              :                         // Autosized input is not allowed
    4800            1 :                     } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow == AutoSize) {
    4801            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4802            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
    4803            0 :                         ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iHeatFlowPerFracCoolNumericNum)));
    4804            0 :                         ErrorsFound = true;
    4805              :                     } else {
    4806              :                         // user input fraction of heating supply air flow rate is saved in ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow
    4807            1 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4808              :                     }
    4809              :                 } else {
    4810            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4811            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
    4812            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatFlowPerFracCoolNumericNum)));
    4813            0 :                     ErrorsFound = true;
    4814              :                 }
    4815            0 :             } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "FlowPerHeatingCapacity")) {
    4816            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = FlowPerHeatingCapacity;
    4817            0 :                 if (!lNumericBlanks(iHeatFlowPerHeatCapNumericNum)) {
    4818            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iHeatFlowPerHeatCapNumericNum);
    4819            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow <= 0.0 &&
    4820            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow != AutoSize) {
    4821            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4822            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
    4823            0 :                         ShowContinueError(
    4824              :                             state,
    4825            0 :                             format("Illegal {} = {:.7T}", cNumericFields(iHeatFlowPerHeatCapNumericNum), Numbers(iHeatFlowPerHeatCapNumericNum)));
    4826            0 :                         ErrorsFound = true;
    4827              :                         // Autosized input is not allowed
    4828            0 :                     } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow == AutoSize) {
    4829            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4830            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
    4831            0 :                         ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iHeatFlowPerHeatCapNumericNum)));
    4832            0 :                         ErrorsFound = true;
    4833              :                     } else {
    4834              :                         // user input heating supply air flow per unit heating capacity is saved in ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow
    4835            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4836              :                     }
    4837              :                 } else {
    4838            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4839            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
    4840            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatFlowPerHeatCapNumericNum)));
    4841            0 :                     ErrorsFound = true;
    4842              :                 }
    4843            0 :             } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "None") || lAlphaBlanks(iHeatSAFMAlphaNum)) {
    4844            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = None;
    4845            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = 0.0;
    4846              :             } else {
    4847            0 :                 ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4848            0 :                 ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
    4849            0 :                 ErrorsFound = true;
    4850              :             }
    4851              : 
    4852              :             // Determine supply air flow rate sizing method when cooling or heating is not needed
    4853            4 :             if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "SupplyAirFlowRate")) {
    4854            3 :                 state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = SupplyAirFlowRate;
    4855            3 :                 if (!lNumericBlanks(iMaxNoCoolHeatAirVolFlowNumericNum)) {
    4856            3 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iMaxNoCoolHeatAirVolFlowNumericNum);
    4857            3 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow == AutoSize) {
    4858            1 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4859              :                     }
    4860            4 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow < 0.0 &&
    4861            1 :                         state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow != AutoSize) {
    4862            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4863            0 :                         ShowContinueError(state,
    4864            0 :                                           format("Illegal {} = {:.7T}",
    4865              :                                                  cNumericFields(iMaxNoCoolHeatAirVolFlowNumericNum),
    4866              :                                                  Numbers(iMaxNoCoolHeatAirVolFlowNumericNum)));
    4867            0 :                         ErrorsFound = true;
    4868              :                     }
    4869              :                 } else {
    4870            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4871            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
    4872            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iMaxNoCoolHeatAirVolFlowNumericNum)));
    4873            0 :                     ErrorsFound = true;
    4874              :                 }
    4875            1 :             } else if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "FlowPerFloorArea")) {
    4876            1 :                 state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = FlowPerFloorArea;
    4877            1 :                 if (!lNumericBlanks(iNoCoolHeatFlowPerFloorAreaNumericNum)) {
    4878            1 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iNoCoolHeatFlowPerFloorAreaNumericNum);
    4879            1 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow < 0.0 &&
    4880            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow != AutoSize) {
    4881            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4882            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
    4883            0 :                         ShowContinueError(state,
    4884            0 :                                           format("Illegal {} = {:.7T}",
    4885              :                                                  cNumericFields(iNoCoolHeatFlowPerFloorAreaNumericNum),
    4886              :                                                  Numbers(iNoCoolHeatFlowPerFloorAreaNumericNum)));
    4887            0 :                         ErrorsFound = true;
    4888              :                         // Autosized input is not allowed
    4889            1 :                     } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow == AutoSize) {
    4890            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4891            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
    4892            0 :                         ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iNoCoolHeatFlowPerFloorAreaNumericNum)));
    4893            0 :                         ErrorsFound = true;
    4894              :                     } else {
    4895              :                         // user input supply air flow per unit floor area during no cooling or heating area is saved in
    4896              :                         // ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow
    4897            1 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4898              :                     }
    4899              :                 } else {
    4900            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4901            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
    4902            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iNoCoolHeatFlowPerFloorAreaNumericNum)));
    4903            0 :                     ErrorsFound = true;
    4904              :                 }
    4905            0 :             } else if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "FractionOfAutosizedCoolingAirflow")) {
    4906            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = FractionOfAutosizedCoolingAirflow;
    4907            0 :                 if (!lNumericBlanks(iNoCoolHeatFlowPerFracCoolNumericNum)) {
    4908            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iNoCoolHeatFlowPerFracCoolNumericNum);
    4909            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow < 0.0 &&
    4910            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow != AutoSize) {
    4911            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4912            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
    4913            0 :                         ShowContinueError(state,
    4914            0 :                                           format("Illegal {} = {:.7T}",
    4915              :                                                  cNumericFields(iNoCoolHeatFlowPerFracCoolNumericNum),
    4916              :                                                  Numbers(iNoCoolHeatFlowPerFracCoolNumericNum)));
    4917            0 :                         ErrorsFound = true;
    4918              :                         // Autosized input is not allowed
    4919            0 :                     } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow == AutoSize) {
    4920            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4921            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
    4922            0 :                         ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iNoCoolHeatFlowPerFracCoolNumericNum)));
    4923            0 :                         ErrorsFound = true;
    4924              :                     } else {
    4925              :                         // user input fraction of cooling supply air flow rate during no cooling or heating area is saved in
    4926              :                         // ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow
    4927            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4928              :                     }
    4929              :                 } else {
    4930            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4931            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
    4932            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iNoCoolHeatFlowPerFracCoolNumericNum)));
    4933            0 :                     ErrorsFound = true;
    4934              :                 }
    4935            0 :             } else if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "FractionOfAutosizedHeatingAirflow")) {
    4936            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = FractionOfAutosizedHeatingAirflow;
    4937            0 :                 if (!lNumericBlanks(iNoCoolHeatFlowPerFracHeatNumericNum)) {
    4938            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iNoCoolHeatFlowPerFracHeatNumericNum);
    4939            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow < 0.0 &&
    4940            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow != AutoSize) {
    4941            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4942            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
    4943            0 :                         ShowContinueError(state,
    4944            0 :                                           format("Illegal {} = {:.7T}",
    4945              :                                                  cNumericFields(iNoCoolHeatFlowPerFracHeatNumericNum),
    4946              :                                                  Numbers(iNoCoolHeatFlowPerFracHeatNumericNum)));
    4947            0 :                         ErrorsFound = true;
    4948              :                         // Autosized input is not allowed
    4949            0 :                     } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow == AutoSize) {
    4950            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4951            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
    4952            0 :                         ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iNoCoolHeatFlowPerFracHeatNumericNum)));
    4953            0 :                         ErrorsFound = true;
    4954              :                     } else {
    4955              :                         // user input fraction of heating supply air flow rate during no cooling or heating area is saved in
    4956              :                         // ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow
    4957            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4958              :                     }
    4959              :                 } else {
    4960            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4961            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
    4962            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iNoCoolHeatFlowPerFracHeatNumericNum)));
    4963            0 :                     ErrorsFound = true;
    4964              :                 }
    4965            0 :             } else if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "None") || lAlphaBlanks(iNoCoolHeatSAFMAlphaNum)) {
    4966            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = None;
    4967            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = 0.0;
    4968              :             } else {
    4969            0 :                 ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4970            0 :                 ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
    4971            0 :                 ErrorsFound = true;
    4972              :             }
    4973              : 
    4974              :             // Determine cooling design capacity of zoneHVAC equipment
    4975            4 :             if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "CoolingDesignCapacity")) {
    4976            2 :                 state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = CoolingDesignCapacity;
    4977            2 :                 if (!lNumericBlanks(iCoolDesignCapacityNumericNum)) {
    4978            2 :                     state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity = Numbers(iCoolDesignCapacityNumericNum);
    4979            2 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity == AutoSize) {
    4980            2 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4981              :                     }
    4982            4 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity < 0.0 &&
    4983            2 :                         state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity != AutoSize) {
    4984            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4985            0 :                         ShowContinueError(
    4986              :                             state,
    4987            0 :                             format("Illegal {} = {:.7T}", cNumericFields(iCoolDesignCapacityNumericNum), Numbers(iCoolDesignCapacityNumericNum)));
    4988            0 :                         ErrorsFound = true;
    4989              :                     }
    4990              :                 } else {
    4991            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    4992            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolCAPMAlphaNum), Alphas(iCoolCAPMAlphaNum)));
    4993            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolDesignCapacityNumericNum)));
    4994            0 :                     ErrorsFound = true;
    4995              :                 }
    4996            2 :             } else if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "CapacityPerFloorArea")) {
    4997            1 :                 state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = CapacityPerFloorArea;
    4998            1 :                 if (!lNumericBlanks(iCoolCapacityPerFloorAreaNumericNum)) {
    4999            1 :                     state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity = Numbers(iCoolCapacityPerFloorAreaNumericNum);
    5000            1 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity <= 0.0) {
    5001            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5002            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolCAPMAlphaNum), Alphas(iCoolCAPMAlphaNum)));
    5003            0 :                         ShowContinueError(state,
    5004            0 :                                           format("Illegal {} = {:.7T}",
    5005              :                                                  cNumericFields(iCoolCapacityPerFloorAreaNumericNum),
    5006              :                                                  Numbers(iCoolCapacityPerFloorAreaNumericNum)));
    5007            0 :                         ErrorsFound = true;
    5008              :                         // Autosized input is not allowed
    5009            1 :                     } else if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity == AutoSize) {
    5010            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5011            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolCAPMAlphaNum), Alphas(iCoolCAPMAlphaNum)));
    5012            0 :                         ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iCoolCapacityPerFloorAreaNumericNum)));
    5013            0 :                         ErrorsFound = true;
    5014              :                     }
    5015              :                 } else {
    5016            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5017            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolCAPMAlphaNum), Alphas(iCoolCAPMAlphaNum)));
    5018            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolCapacityPerFloorAreaNumericNum)));
    5019            0 :                     ErrorsFound = true;
    5020              :                 }
    5021            1 :             } else if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "FractionOfAutosizedCoolingCapacity")) {
    5022            1 :                 state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = FractionOfAutosizedCoolingCapacity;
    5023            1 :                 if (!lNumericBlanks(iCoolFracOfAutosizedCapacityNumericNum)) {
    5024            1 :                     state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity = Numbers(iCoolFracOfAutosizedCapacityNumericNum);
    5025            1 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity == AutoSize) {
    5026            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    5027              :                     }
    5028            1 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity < 0.0 &&
    5029            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity != AutoSize) {
    5030            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5031            0 :                         ShowContinueError(state,
    5032            0 :                                           format("Illegal {} = {:.7T}",
    5033              :                                                  cNumericFields(iCoolFracOfAutosizedCapacityNumericNum),
    5034              :                                                  Numbers(iCoolFracOfAutosizedCapacityNumericNum)));
    5035            0 :                         ErrorsFound = true;
    5036              :                     }
    5037              :                 } else {
    5038            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5039            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolCAPMAlphaNum), Alphas(iCoolCAPMAlphaNum)));
    5040            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolFracOfAutosizedCapacityNumericNum)));
    5041            0 :                     ErrorsFound = true;
    5042              :                 }
    5043            0 :             } else if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "None") || lAlphaBlanks(iCoolCAPMAlphaNum)) {
    5044            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = None;
    5045              :             } else {
    5046            0 :                 ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5047            0 :                 ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(iCoolCAPMAlphaNum), Alphas(iCoolCAPMAlphaNum)));
    5048            0 :                 ErrorsFound = true;
    5049              :             }
    5050              : 
    5051              :             // Determine heating design capacity of zone HVAC equipment
    5052            4 :             if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) {
    5053            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = HeatingDesignCapacity;
    5054            0 :                 if (!lNumericBlanks(iHeatDesignCapacityNumericNum)) {
    5055            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity = Numbers(iHeatDesignCapacityNumericNum);
    5056            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity == AutoSize) {
    5057            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    5058              :                     }
    5059            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity < 0.0 &&
    5060            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity != AutoSize) {
    5061            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5062            0 :                         ShowContinueError(
    5063              :                             state,
    5064            0 :                             format("Illegal {} = {:.7T}", cNumericFields(iHeatDesignCapacityNumericNum), Numbers(iHeatDesignCapacityNumericNum)));
    5065            0 :                         ErrorsFound = true;
    5066              :                     }
    5067              :                 } else {
    5068            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5069            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatCAPMAlphaNum), Alphas(iHeatCAPMAlphaNum)));
    5070            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatDesignCapacityNumericNum)));
    5071            0 :                     ErrorsFound = true;
    5072              :                 }
    5073            4 :             } else if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) {
    5074            3 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = CapacityPerFloorArea;
    5075            3 :                 if (!lNumericBlanks(iHeatCapacityPerFloorAreaNumericNum)) {
    5076            3 :                     state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity = Numbers(iHeatCapacityPerFloorAreaNumericNum);
    5077            3 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity <= 0.0) {
    5078            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5079            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatCAPMAlphaNum), Alphas(iHeatCAPMAlphaNum)));
    5080            0 :                         ShowContinueError(state,
    5081            0 :                                           format("Illegal {} = {:.7T}",
    5082              :                                                  cNumericFields(iHeatCapacityPerFloorAreaNumericNum),
    5083              :                                                  Numbers(iHeatCapacityPerFloorAreaNumericNum)));
    5084            0 :                         ErrorsFound = true;
    5085              :                         // Autosized input is not allowed
    5086            3 :                     } else if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity == AutoSize) {
    5087            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5088            0 :                         ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatCAPMAlphaNum), Alphas(iHeatCAPMAlphaNum)));
    5089            0 :                         ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iHeatCapacityPerFloorAreaNumericNum)));
    5090            0 :                         ErrorsFound = true;
    5091              :                     }
    5092              :                 } else {
    5093            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5094            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatCAPMAlphaNum), Alphas(iHeatCAPMAlphaNum)));
    5095            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatCapacityPerFloorAreaNumericNum)));
    5096            0 :                     ErrorsFound = true;
    5097              :                 }
    5098            1 :             } else if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) {
    5099            1 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = FractionOfAutosizedHeatingCapacity;
    5100            1 :                 if (!lNumericBlanks(iHeatFracOfAutosizedCapacityNumericNum)) {
    5101            1 :                     state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity = Numbers(iHeatFracOfAutosizedCapacityNumericNum);
    5102            1 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity == AutoSize) {
    5103            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    5104              :                     }
    5105            1 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity < 0.0 &&
    5106            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity != AutoSize) {
    5107            0 :                         ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5108            0 :                         ShowContinueError(state,
    5109            0 :                                           format("Illegal {} = {:.7T}",
    5110              :                                                  cNumericFields(iHeatFracOfAutosizedCapacityNumericNum),
    5111              :                                                  Numbers(iHeatFracOfAutosizedCapacityNumericNum)));
    5112            0 :                         ErrorsFound = true;
    5113              :                     }
    5114              :                 } else {
    5115            0 :                     ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5116            0 :                     ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatCAPMAlphaNum), Alphas(iHeatCAPMAlphaNum)));
    5117            0 :                     ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatFracOfAutosizedCapacityNumericNum)));
    5118            0 :                     ErrorsFound = true;
    5119              :                 }
    5120            0 :             } else if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "None") || lAlphaBlanks(iHeatCAPMAlphaNum)) {
    5121            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = None;
    5122              :             } else {
    5123            0 :                 ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
    5124            0 :                 ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(iHeatCAPMAlphaNum), Alphas(iHeatCAPMAlphaNum)));
    5125            0 :                 ErrorsFound = true;
    5126              :             }
    5127              :         }
    5128              :     }
    5129              : 
    5130          801 :     Alphas.deallocate();
    5131          801 :     cAlphaFields.deallocate();
    5132          801 :     cNumericFields.deallocate();
    5133          801 :     Numbers.deallocate();
    5134          801 :     lAlphaBlanks.deallocate();
    5135          801 :     lNumericBlanks.deallocate();
    5136              : 
    5137          801 :     if (ErrorsFound) {
    5138            0 :         ShowFatalError(state, format("{}Errors found in input.  Preceding condition(s) cause termination.", RoutineName));
    5139              :     }
    5140          801 : }
    5141              : 
    5142          801 : void GetAirTerminalSizing(EnergyPlusData &state)
    5143              : {
    5144              :     // SUBROUTINE INFORMATION:
    5145              :     //       AUTHOR         M.J. Witte
    5146              :     //       DATE WRITTEN   February 2017
    5147              : 
    5148              :     // PURPOSE OF THIS SUBROUTINE:
    5149              :     // Obtains input data for the AirTerminal sizing methods object and stores it in
    5150              :     // appropriate data structure.
    5151              : 
    5152              :     static constexpr std::string_view RoutineName("GetAirTerminalSizing: "); // include trailing blank space
    5153              : 
    5154              :     int NumAlphas;           // Number of Alphas for each GetObjectItem call
    5155              :     int NumNumbers;          // Number of Numbers for each GetObjectItem call
    5156              :     int TotalArgs;           // Total number of alpha and numeric arguments (max) for a
    5157          801 :     bool ErrorsFound(false); // If errors detected in input
    5158          801 :     auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
    5159          801 :     cCurrentModuleObject = "DesignSpecification:AirTerminal:Sizing";
    5160          801 :     state.dataSize->NumAirTerminalSizingSpec = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    5161          801 :     state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, TotalArgs, NumAlphas, NumNumbers);
    5162              : 
    5163          801 :     if (state.dataSize->NumAirTerminalSizingSpec > 0) {
    5164              :         int IOStatus; // Used in GetObjectItem
    5165            8 :         state.dataSize->AirTerminalSizingSpec.allocate(state.dataSize->NumAirTerminalSizingSpec);
    5166              : 
    5167              :         // Start Loading the System Input
    5168           24 :         for (int zSIndex = 1; zSIndex <= state.dataSize->NumAirTerminalSizingSpec; ++zSIndex) {
    5169              : 
    5170           32 :             state.dataInputProcessing->inputProcessor->getObjectItem(state,
    5171              :                                                                      cCurrentModuleObject,
    5172              :                                                                      zSIndex,
    5173           16 :                                                                      state.dataIPShortCut->cAlphaArgs,
    5174              :                                                                      NumAlphas,
    5175           16 :                                                                      state.dataIPShortCut->rNumericArgs,
    5176              :                                                                      NumNumbers,
    5177              :                                                                      IOStatus,
    5178           16 :                                                                      state.dataIPShortCut->lNumericFieldBlanks,
    5179           16 :                                                                      state.dataIPShortCut->lAlphaFieldBlanks,
    5180           16 :                                                                      state.dataIPShortCut->cAlphaFieldNames,
    5181           16 :                                                                      state.dataIPShortCut->cNumericFieldNames);
    5182              : 
    5183           16 :             Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound);
    5184              : 
    5185           16 :             auto &thisATSizing = state.dataSize->AirTerminalSizingSpec(zSIndex);
    5186           16 :             thisATSizing.Name = state.dataIPShortCut->cAlphaArgs(1);
    5187           16 :             thisATSizing.DesSensCoolingFrac = state.dataIPShortCut->rNumericArgs(1);
    5188           16 :             thisATSizing.DesCoolSATRatio = state.dataIPShortCut->rNumericArgs(2);
    5189           16 :             thisATSizing.DesSensHeatingFrac = state.dataIPShortCut->rNumericArgs(3);
    5190           16 :             thisATSizing.DesHeatSATRatio = state.dataIPShortCut->rNumericArgs(4);
    5191           16 :             thisATSizing.MinOAFrac = state.dataIPShortCut->rNumericArgs(5);
    5192              :         }
    5193              :     }
    5194              : 
    5195          801 :     if (ErrorsFound) {
    5196            0 :         ShowFatalError(state, format("{}Errors found in input.  Preceding condition(s) cause termination.", RoutineName));
    5197              :     }
    5198          801 : }
    5199              : 
    5200              : // Update the sizing for the entire facility to gather values for reporting - Glazer January 2017
    5201       142240 : void UpdateFacilitySizing([[maybe_unused]] EnergyPlusData &state, Constant::CallIndicator const CallIndicator)
    5202              : {
    5203       142240 :     int NumOfTimeStepInDay = state.dataGlobal->TimeStepsInHour * Constant::iHoursInDay;
    5204              : 
    5205       142240 :     auto &CalcFacilitySizing = state.dataSize->CalcFacilitySizing;
    5206       142240 :     auto &CalcFinalFacilitySizing = state.dataSize->CalcFinalFacilitySizing;
    5207              : 
    5208              :     //  test if allocated here
    5209       142240 :     if (!CalcFacilitySizing.allocated()) {
    5210          428 :         CalcFacilitySizing.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays);
    5211         1347 :         for (int DDNum = 1; DDNum <= state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays; ++DDNum) {
    5212          919 :             CalcFacilitySizing(DDNum).DOASHeatAddSeq.allocate(NumOfTimeStepInDay);
    5213          919 :             CalcFacilitySizing(DDNum).DOASLatAddSeq.allocate(NumOfTimeStepInDay);
    5214          919 :             CalcFacilitySizing(DDNum).CoolOutHumRatSeq.allocate(NumOfTimeStepInDay);
    5215          919 :             CalcFacilitySizing(DDNum).CoolOutTempSeq.allocate(NumOfTimeStepInDay);
    5216          919 :             CalcFacilitySizing(DDNum).CoolZoneTempSeq.allocate(NumOfTimeStepInDay);
    5217          919 :             CalcFacilitySizing(DDNum).CoolLoadSeq.allocate(NumOfTimeStepInDay);
    5218          919 :             CalcFacilitySizing(DDNum).HeatOutHumRatSeq.allocate(NumOfTimeStepInDay);
    5219          919 :             CalcFacilitySizing(DDNum).HeatOutTempSeq.allocate(NumOfTimeStepInDay);
    5220          919 :             CalcFacilitySizing(DDNum).HeatZoneTempSeq.allocate(NumOfTimeStepInDay);
    5221          919 :             CalcFacilitySizing(DDNum).HeatLoadSeq.allocate(NumOfTimeStepInDay);
    5222              : 
    5223          919 :             CalcFacilitySizing(DDNum).DOASHeatAddSeq = 0.;
    5224          919 :             CalcFacilitySizing(DDNum).DOASLatAddSeq = 0.;
    5225          919 :             CalcFacilitySizing(DDNum).CoolOutHumRatSeq = 0.;
    5226          919 :             CalcFacilitySizing(DDNum).CoolOutTempSeq = 0.;
    5227          919 :             CalcFacilitySizing(DDNum).CoolZoneTempSeq = 0.;
    5228          919 :             CalcFacilitySizing(DDNum).CoolLoadSeq = 0.;
    5229          919 :             CalcFacilitySizing(DDNum).HeatOutHumRatSeq = 0.;
    5230          919 :             CalcFacilitySizing(DDNum).HeatOutTempSeq = 0.;
    5231          919 :             CalcFacilitySizing(DDNum).HeatZoneTempSeq = 0.;
    5232          919 :             CalcFacilitySizing(DDNum).HeatLoadSeq = 0.;
    5233              :         }
    5234              :     }
    5235       142240 :     if (!CalcFinalFacilitySizing.DOASHeatAddSeq.allocated()) {
    5236          428 :         CalcFinalFacilitySizing.DOASHeatAddSeq.allocate(NumOfTimeStepInDay);
    5237          428 :         CalcFinalFacilitySizing.DOASLatAddSeq.allocate(NumOfTimeStepInDay);
    5238          428 :         CalcFinalFacilitySizing.CoolOutHumRatSeq.allocate(NumOfTimeStepInDay);
    5239          428 :         CalcFinalFacilitySizing.CoolOutTempSeq.allocate(NumOfTimeStepInDay);
    5240          428 :         CalcFinalFacilitySizing.CoolZoneTempSeq.allocate(NumOfTimeStepInDay);
    5241          428 :         CalcFinalFacilitySizing.CoolLoadSeq.allocate(NumOfTimeStepInDay);
    5242          428 :         CalcFinalFacilitySizing.HeatOutHumRatSeq.allocate(NumOfTimeStepInDay);
    5243          428 :         CalcFinalFacilitySizing.HeatOutTempSeq.allocate(NumOfTimeStepInDay);
    5244          428 :         CalcFinalFacilitySizing.HeatZoneTempSeq.allocate(NumOfTimeStepInDay);
    5245          428 :         CalcFinalFacilitySizing.HeatLoadSeq.allocate(NumOfTimeStepInDay);
    5246              : 
    5247          428 :         CalcFinalFacilitySizing.DOASHeatAddSeq = 0.;
    5248          428 :         CalcFinalFacilitySizing.DOASLatAddSeq = 0.;
    5249          428 :         CalcFinalFacilitySizing.CoolOutHumRatSeq = 0.;
    5250          428 :         CalcFinalFacilitySizing.CoolOutTempSeq = 0.;
    5251          428 :         CalcFinalFacilitySizing.CoolZoneTempSeq = 0.;
    5252          428 :         CalcFinalFacilitySizing.CoolLoadSeq = 0.;
    5253          428 :         CalcFinalFacilitySizing.HeatOutHumRatSeq = 0.;
    5254          428 :         CalcFinalFacilitySizing.HeatOutTempSeq = 0.;
    5255          428 :         CalcFinalFacilitySizing.HeatZoneTempSeq = 0.;
    5256          428 :         CalcFinalFacilitySizing.HeatLoadSeq = 0.;
    5257              :     }
    5258       142240 :     if (CallIndicator == Constant::CallIndicator::BeginDay) {
    5259          973 :         CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatDDNum = state.dataSize->CurOverallSimDay;
    5260          973 :         CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolDDNum = state.dataSize->CurOverallSimDay;
    5261       141267 :     } else if (CallIndicator == Constant::CallIndicator::DuringDay) {
    5262       138899 :         int TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->TimeStepsInHour + state.dataGlobal->TimeStep;
    5263              :         // save the results of the ideal zone component calculation in the CalcZoneSizing sequence variables
    5264       138899 :         Real64 sumCoolLoad = 0.;
    5265       138899 :         Real64 sumHeatLoad = 0.;
    5266       138899 :         Real64 wghtdCoolZoneTemp = 0.;
    5267       138899 :         Real64 wghtdHeatZoneTemp = 0.;
    5268       138899 :         Real64 wghtdCoolHumRat = 0.;
    5269       138899 :         Real64 wghtdHeatHumRat = 0.;
    5270       138899 :         Real64 wghtdCoolDOASHeatAdd = 0.;
    5271       138899 :         Real64 wghtdCoolDOASLatAdd = 0.;
    5272      1472192 :         for (int CtrlZoneNum = 1; CtrlZoneNum <= state.dataGlobal->NumOfZones; ++CtrlZoneNum) {
    5273      1333293 :             if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum).IsControlled) {
    5274       151559 :                 continue;
    5275              :             }
    5276      1181734 :             auto const &thisCalcZoneSizing = state.dataSize->CalcZoneSizing(state.dataSize->CurOverallSimDay, CtrlZoneNum);
    5277      1181734 :             Real64 curCoolLoad = thisCalcZoneSizing.CoolLoadSeq(TimeStepInDay);
    5278      1181734 :             if (curCoolLoad > 0.0) {
    5279       535765 :                 sumCoolLoad += curCoolLoad;
    5280       535765 :                 wghtdCoolZoneTemp += thisCalcZoneSizing.CoolZoneTempSeq(TimeStepInDay) * curCoolLoad;
    5281       535765 :                 wghtdCoolHumRat += thisCalcZoneSizing.CoolZoneHumRatSeq(TimeStepInDay) * curCoolLoad;
    5282       535765 :                 wghtdCoolDOASHeatAdd += thisCalcZoneSizing.DOASHeatAddSeq(TimeStepInDay) * curCoolLoad;
    5283       535765 :                 wghtdCoolDOASLatAdd += thisCalcZoneSizing.DOASLatAddSeq(TimeStepInDay) * curCoolLoad;
    5284              :             }
    5285      1181734 :             Real64 curHeatLoad = thisCalcZoneSizing.HeatLoadSeq(TimeStepInDay);
    5286      1181734 :             if (curHeatLoad > 0.0) {
    5287       483376 :                 sumHeatLoad += curHeatLoad;
    5288       483376 :                 wghtdHeatZoneTemp += thisCalcZoneSizing.HeatZoneTempSeq(TimeStepInDay) * curHeatLoad;
    5289       483376 :                 wghtdHeatHumRat += thisCalcZoneSizing.HeatZoneHumRatSeq(TimeStepInDay) * curHeatLoad;
    5290              :             }
    5291              :         }
    5292              : 
    5293       138899 :         CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolLoadSeq(TimeStepInDay) = sumCoolLoad;
    5294       138899 :         CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatLoadSeq(TimeStepInDay) = sumHeatLoad;
    5295              : 
    5296       138899 :         if (sumCoolLoad != 0.) {
    5297        62153 :             CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolZoneTempSeq(TimeStepInDay) = wghtdCoolZoneTemp / sumCoolLoad;
    5298        62153 :             CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolOutHumRatSeq(TimeStepInDay) = wghtdCoolHumRat / sumCoolLoad;
    5299        62153 :             CalcFacilitySizing(state.dataSize->CurOverallSimDay).DOASHeatAddSeq(TimeStepInDay) = wghtdCoolDOASHeatAdd / sumCoolLoad;
    5300        62153 :             CalcFacilitySizing(state.dataSize->CurOverallSimDay).DOASLatAddSeq(TimeStepInDay) = wghtdCoolDOASLatAdd / sumCoolLoad;
    5301              :         }
    5302       138899 :         if (sumHeatLoad != 0.) {
    5303        63657 :             CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatZoneTempSeq(TimeStepInDay) = wghtdHeatZoneTemp / sumHeatLoad;
    5304        63657 :             CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatOutHumRatSeq(TimeStepInDay) = wghtdHeatHumRat / sumHeatLoad;
    5305              :         }
    5306              : 
    5307         2368 :     } else if (CallIndicator == Constant::CallIndicator::EndDay) {
    5308       238985 :         for (int TimeStepIndex = 1; TimeStepIndex <= NumOfTimeStepInDay; ++TimeStepIndex) {
    5309       237072 :             if (CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolLoadSeq(TimeStepIndex) >
    5310       237072 :                 CalcFacilitySizing(state.dataSize->CurOverallSimDay).DesCoolLoad) {
    5311        16690 :                 CalcFacilitySizing(state.dataSize->CurOverallSimDay).DesCoolLoad =
    5312        16690 :                     CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolLoadSeq(TimeStepIndex);
    5313        16690 :                 CalcFacilitySizing(state.dataSize->CurOverallSimDay).TimeStepNumAtCoolMax = TimeStepIndex;
    5314              :             }
    5315       237072 :             if (CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatLoadSeq(TimeStepIndex) >
    5316       237072 :                 CalcFacilitySizing(state.dataSize->CurOverallSimDay).DesHeatLoad) {
    5317        31825 :                 CalcFacilitySizing(state.dataSize->CurOverallSimDay).DesHeatLoad =
    5318        31825 :                     CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatLoadSeq(TimeStepIndex);
    5319        31825 :                 CalcFacilitySizing(state.dataSize->CurOverallSimDay).TimeStepNumAtHeatMax = TimeStepIndex;
    5320              :             }
    5321              :         }
    5322              : 
    5323          455 :     } else if (CallIndicator == Constant::CallIndicator::EndZoneSizingCalc) {
    5324         1428 :         for (int DDNum = 1; DDNum <= state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays; ++DDNum) {
    5325          973 :             if (CalcFacilitySizing(DDNum).DesCoolLoad > CalcFinalFacilitySizing.DesCoolLoad) {
    5326          468 :                 CalcFinalFacilitySizing.DesCoolLoad = CalcFacilitySizing(DDNum).DesCoolLoad;
    5327          468 :                 CalcFinalFacilitySizing.TimeStepNumAtCoolMax = CalcFacilitySizing(DDNum).TimeStepNumAtCoolMax;
    5328          468 :                 CalcFinalFacilitySizing.CoolDDNum = CalcFacilitySizing(DDNum).CoolDDNum;
    5329        58572 :                 for (int TimeStepIndex = 1; TimeStepIndex <= NumOfTimeStepInDay; ++TimeStepIndex) {
    5330        58104 :                     CalcFinalFacilitySizing.CoolOutHumRatSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).CoolOutHumRatSeq(TimeStepIndex);
    5331        58104 :                     CalcFinalFacilitySizing.CoolOutTempSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).CoolOutTempSeq(TimeStepIndex);
    5332        58104 :                     CalcFinalFacilitySizing.CoolZoneTempSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).CoolZoneTempSeq(TimeStepIndex);
    5333        58104 :                     CalcFinalFacilitySizing.DOASHeatAddSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).DOASHeatAddSeq(TimeStepIndex);
    5334        58104 :                     CalcFinalFacilitySizing.DOASLatAddSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).DOASLatAddSeq(TimeStepIndex);
    5335              :                 }
    5336              :             }
    5337          973 :             if (CalcFacilitySizing(DDNum).DesHeatLoad > CalcFinalFacilitySizing.DesHeatLoad) {
    5338          453 :                 CalcFinalFacilitySizing.DesHeatLoad = CalcFacilitySizing(DDNum).DesHeatLoad;
    5339          453 :                 CalcFinalFacilitySizing.TimeStepNumAtHeatMax = CalcFacilitySizing(DDNum).TimeStepNumAtHeatMax;
    5340          453 :                 CalcFinalFacilitySizing.HeatDDNum = CalcFacilitySizing(DDNum).HeatDDNum;
    5341        56301 :                 for (int TimeStepIndex = 1; TimeStepIndex <= NumOfTimeStepInDay; ++TimeStepIndex) {
    5342        55848 :                     CalcFinalFacilitySizing.HeatOutHumRatSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).HeatOutHumRatSeq(TimeStepIndex);
    5343        55848 :                     CalcFinalFacilitySizing.HeatOutTempSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).HeatOutTempSeq(TimeStepIndex);
    5344        55848 :                     CalcFinalFacilitySizing.HeatZoneTempSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).HeatZoneTempSeq(TimeStepIndex);
    5345              :                 }
    5346              :             }
    5347              :         }
    5348              :     }
    5349       142240 : }
    5350              : 
    5351          427 : void UpdateTermUnitFinalZoneSizing(EnergyPlusData &state)
    5352              : {
    5353              :     // Move data from FinalZoneSizing to TermUnitFinalZoneSizing and apply terminal unit sizing adjustments
    5354              :     // Called once to initialize before system sizing
    5355              :     // M.J. Witte, July 2017
    5356              : 
    5357         4409 :     for (int termUnitSizingIndex = 1; termUnitSizingIndex <= state.dataSize->NumAirTerminalUnits; ++termUnitSizingIndex) {
    5358         3982 :         auto &thisTUFZSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
    5359         3982 :         auto &thisTUSizing = state.dataSize->TermUnitSizing(termUnitSizingIndex);
    5360         3982 :         int ctrlZoneNum = thisTUSizing.CtrlZoneNum;
    5361         3982 :         auto const &thisFZSizing = state.dataSize->FinalZoneSizing(ctrlZoneNum);
    5362              : 
    5363              :         // Copy everything from FinalZoneSizing to TermUnitFinalZoneSizing
    5364         3982 :         thisTUFZSizing.copyFromZoneSizing(thisFZSizing);
    5365         3982 :         thisTUFZSizing.ADUName = thisTUSizing.ADUName;
    5366              : 
    5367         3982 :         if (state.dataSize->NumAirTerminalSizingSpec > 0) {
    5368              :             // Apply DesignSpecification:AirTerminal:Sizing adjustments - default ratios are 1.0
    5369           40 :             Real64 minOAFrac = thisTUSizing.SpecMinOAFrac;
    5370              :             // Outdoor air
    5371           40 :             thisTUFZSizing.MinOA = thisFZSizing.MinOA * minOAFrac;
    5372           40 :             thisTUFZSizing.TotalOAFromPeople = thisFZSizing.TotalOAFromPeople * minOAFrac;
    5373           40 :             thisTUFZSizing.TotalOAFromArea = thisFZSizing.TotalOAFromArea * minOAFrac;
    5374           40 :             Real64 minOACoolMassFlow = thisTUFZSizing.MinOA * thisFZSizing.DesCoolDens;
    5375           40 :             Real64 minOAHeatMassFlow = thisTUFZSizing.MinOA * thisFZSizing.DesHeatDens;
    5376              :             // Cooling
    5377           40 :             Real64 coolFlowRatio = 1.0;
    5378           40 :             if (thisTUSizing.SpecDesCoolSATRatio > 0.0) {
    5379           40 :                 coolFlowRatio = thisTUSizing.SpecDesSensCoolingFrac / thisTUSizing.SpecDesCoolSATRatio;
    5380              :             } else {
    5381            0 :                 coolFlowRatio = thisTUSizing.SpecDesSensCoolingFrac;
    5382              :             }
    5383           40 :             Real64 coolLoadRatio = thisTUSizing.SpecDesSensCoolingFrac;
    5384           40 :             thisTUFZSizing.DesCoolLoad = thisFZSizing.DesCoolLoad * coolLoadRatio;
    5385           40 :             thisTUFZSizing.NonAirSysDesCoolLoad = thisFZSizing.NonAirSysDesCoolLoad * coolLoadRatio;
    5386           40 :             thisTUFZSizing.NonAirSysDesCoolVolFlow = thisFZSizing.NonAirSysDesCoolVolFlow * coolFlowRatio;
    5387              :             // Adjust DesCoolVolFlow, DesCoolMassFlow, and CoolFlowSeq with cooling frac, SAT ratio, and minOA frac adjustments
    5388           40 :             thisTUFZSizing.DesCoolVolFlow = thisTUSizing.applyTermUnitSizingCoolFlow(thisFZSizing.DesCoolVolFlow, thisFZSizing.DesCoolVolFlowNoOA);
    5389           40 :             thisTUFZSizing.DesCoolVolFlow = max(thisTUFZSizing.DesCoolVolFlow, thisTUFZSizing.MinOA);
    5390           40 :             thisTUFZSizing.DesCoolVolFlowNoOA = thisFZSizing.DesCoolVolFlowNoOA * coolFlowRatio;
    5391           40 :             thisTUFZSizing.DesCoolMassFlow = thisTUFZSizing.DesCoolVolFlow * thisFZSizing.DesCoolDens;
    5392           40 :             thisTUFZSizing.DesCoolMassFlow = max(thisTUFZSizing.DesCoolMassFlow, minOACoolMassFlow);
    5393           40 :             thisTUFZSizing.DesCoolMassFlowNoOA = thisTUFZSizing.DesCoolVolFlowNoOA * thisFZSizing.DesCoolDens;
    5394         4360 :             for (int timeIndex = 1; timeIndex <= (state.dataGlobal->TimeStepsInHour * Constant::iHoursInDay); ++timeIndex) {
    5395         8640 :                 thisTUFZSizing.CoolFlowSeq(timeIndex) =
    5396         4320 :                     thisTUSizing.applyTermUnitSizingCoolFlow(thisFZSizing.CoolFlowSeq(timeIndex), thisFZSizing.CoolFlowSeqNoOA(timeIndex));
    5397         4320 :                 thisTUFZSizing.CoolFlowSeq(timeIndex) = max(thisTUFZSizing.CoolFlowSeq(timeIndex), minOACoolMassFlow);
    5398         4320 :                 thisTUFZSizing.CoolFlowSeqNoOA(timeIndex) = thisFZSizing.CoolFlowSeqNoOA(timeIndex) * coolFlowRatio;
    5399              :             }
    5400              :             // Adjust for possible MinOA impact on DesCoolVolFlowMin, with cooling frac adjustment but no SAT adjustment
    5401           40 :             thisTUFZSizing.DesCoolMinAirFlow =
    5402           40 :                 thisFZSizing.DesCoolMinAirFlow * thisTUSizing.SpecDesSensCoolingFrac; // no SAT adjustment, this is a straight flow rate input
    5403           40 :             thisTUFZSizing.DesCoolMinAirFlow2 =
    5404           40 :                 thisFZSizing.DesCoolMinAirFlow2 * thisTUSizing.SpecDesSensCoolingFrac; // no SAT adjustment, this is based on area
    5405           80 :             thisTUFZSizing.DesCoolVolFlowMin = max(thisTUFZSizing.DesCoolMinAirFlow,
    5406              :                                                    thisTUFZSizing.DesCoolMinAirFlow2,
    5407           40 :                                                    thisTUFZSizing.DesCoolVolFlow * thisTUFZSizing.DesCoolMinAirFlowFrac);
    5408              : 
    5409              :             // Heating
    5410           40 :             Real64 heatFlowRatio = 1.0;
    5411           40 :             if (thisTUSizing.SpecDesHeatSATRatio > 0.0) {
    5412           40 :                 heatFlowRatio = thisTUSizing.SpecDesSensHeatingFrac / thisTUSizing.SpecDesHeatSATRatio;
    5413              :             } else {
    5414            0 :                 heatFlowRatio = thisTUSizing.SpecDesSensHeatingFrac;
    5415              :             }
    5416           40 :             Real64 heatLoadRatio = thisTUSizing.SpecDesSensHeatingFrac;
    5417           40 :             thisTUFZSizing.DesHeatLoad = thisFZSizing.DesHeatLoad * heatLoadRatio;
    5418           40 :             thisTUFZSizing.NonAirSysDesHeatLoad = thisFZSizing.NonAirSysDesHeatLoad * heatLoadRatio;
    5419           40 :             thisTUFZSizing.NonAirSysDesHeatVolFlow = thisFZSizing.NonAirSysDesHeatVolFlow * heatFlowRatio;
    5420              :             // Adjust DesHeatVolFlow, DesHeatMassFlow, and HeatFlowSeq with Heating frac, SAT ratio, and minOA frac adjustments
    5421           40 :             thisTUFZSizing.DesHeatVolFlow = thisTUSizing.applyTermUnitSizingHeatFlow(thisFZSizing.DesHeatVolFlow, thisFZSizing.DesHeatVolFlowNoOA);
    5422           40 :             thisTUFZSizing.DesHeatVolFlow = max(thisTUFZSizing.DesHeatVolFlow, thisTUFZSizing.MinOA);
    5423           40 :             thisTUFZSizing.DesHeatVolFlowNoOA = thisFZSizing.DesHeatVolFlowNoOA * heatFlowRatio;
    5424           40 :             thisTUFZSizing.DesHeatMassFlow = thisTUFZSizing.DesHeatVolFlow * thisFZSizing.DesHeatDens;
    5425           40 :             thisTUFZSizing.DesHeatMassFlow = max(thisTUFZSizing.DesHeatMassFlow, minOAHeatMassFlow);
    5426           40 :             thisTUFZSizing.DesHeatMassFlowNoOA = thisTUFZSizing.DesHeatVolFlowNoOA * thisFZSizing.DesHeatDens;
    5427         4360 :             for (int timeIndex = 1; timeIndex <= (state.dataGlobal->TimeStepsInHour * Constant::iHoursInDay); ++timeIndex) {
    5428         8640 :                 thisTUFZSizing.HeatFlowSeq(timeIndex) =
    5429         4320 :                     thisTUSizing.applyTermUnitSizingHeatFlow(thisFZSizing.HeatFlowSeq(timeIndex), thisFZSizing.HeatFlowSeqNoOA(timeIndex));
    5430         4320 :                 thisTUFZSizing.HeatFlowSeq(timeIndex) = max(thisTUFZSizing.HeatFlowSeq(timeIndex), minOAHeatMassFlow);
    5431         4320 :                 thisTUFZSizing.HeatFlowSeqNoOA(timeIndex) = thisFZSizing.HeatFlowSeqNoOA(timeIndex) * heatFlowRatio;
    5432              :             }
    5433              :             // DesHeatVolFlowMax is a mixed bag, so just repeat the original comparison from UpdateZoneSizing using the new flows
    5434           40 :             thisTUFZSizing.DesHeatMaxAirFlow =
    5435           40 :                 thisFZSizing.DesHeatMaxAirFlow * thisTUSizing.SpecDesSensHeatingFrac; // no SAT adjustment, this is a straight flow rate input
    5436           40 :             thisTUFZSizing.DesHeatMaxAirFlow2 =
    5437           40 :                 thisFZSizing.DesHeatMaxAirFlow2 * thisTUSizing.SpecDesSensHeatingFrac; // no SAT adjustment, this is based on area
    5438           40 :             thisTUFZSizing.DesHeatVolFlowMax =
    5439           40 :                 max(thisTUFZSizing.DesHeatMaxAirFlow,
    5440              :                     thisTUFZSizing.DesHeatMaxAirFlow2,
    5441           40 :                     max(thisTUFZSizing.DesCoolVolFlow, thisTUFZSizing.DesHeatVolFlow) * thisTUFZSizing.DesHeatMaxAirFlowFrac);
    5442              :             // Outdoor air fractions
    5443           40 :             if (thisTUFZSizing.DesCoolVolFlow > 0.0) {
    5444           40 :                 thisTUFZSizing.DesCoolOAFlowFrac = min(thisFZSizing.MinOA / thisTUFZSizing.DesCoolVolFlow, 1.0);
    5445              :             } else {
    5446            0 :                 thisTUFZSizing.DesCoolOAFlowFrac = 0.0;
    5447              :             }
    5448           40 :             if (thisTUFZSizing.DesHeatVolFlow > 0.0) {
    5449           40 :                 thisTUFZSizing.DesHeatOAFlowFrac = min(thisFZSizing.MinOA / thisTUFZSizing.DesHeatVolFlow, 1.0);
    5450              :             } else {
    5451            0 :                 thisTUFZSizing.DesHeatOAFlowFrac = 0.0;
    5452              :             }
    5453              :         }
    5454              :     }
    5455          427 : }
    5456              : } // namespace EnergyPlus::SizingManager
        

Generated by: LCOV version 2.0-1