LCOV - code coverage report
Current view: top level - EnergyPlus - SizingManager.cc (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 64.2 % 3335 2140
Test Date: 2025-06-02 12:03:30 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           91 : 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           91 :     bool Available(false); // an environment is available to process
     146           91 :     bool ErrorsFound(false);
     147           91 :     bool SimAir(false);
     148           91 :     bool SimZoneEquip(false);
     149           91 :     int TimeStepInDay(0); // time step number
     150           91 :     int LastMonth(0);
     151           91 :     int LastDayOfMonth(0);
     152           91 :     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           91 :     TimeStepInDay = 0;
     158           91 :     state.dataSize->SysSizingRunDone = false;
     159           91 :     state.dataSize->ZoneSizingRunDone = false;
     160           91 :     curName = "Unknown";
     161           91 :     GetOARequirements(state);      // get the OA requirements object
     162           91 :     GetZoneAirDistribution(state); // get zone air distribution objects
     163           91 :     GetZoneHVACSizing(state);      // get zone HVAC sizing object
     164           91 :     GetAirTerminalSizing(state);   // get air terminal sizing object
     165           91 :     GetSizingParams(state);        // get the building level sizing parameters
     166           91 :     GetZoneSizingInput(state);     // get the Zone Sizing input
     167           91 :     GetSystemSizingInput(state);   // get the System Sizing input
     168           91 :     GetPlantSizingInput(state);    // get the Plant Sizing input
     169              : 
     170              :     // okay, check sizing inputs vs desires vs requirements
     171           91 :     if (state.dataGlobal->DoZoneSizing || state.dataGlobal->DoSystemSizing) {
     172           98 :         if ((state.dataSize->NumSysSizInput > 0 && state.dataSize->NumZoneSizingInput == 0) ||
     173           49 :             (!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           91 :     isUserReqCompLoadReport = isCompLoadRepReq(state); // check getinput structure if load component report is requested
     183              :     bool fileHasSizingPeriodDays =
     184           91 :         hasSizingPeriodsDays(state); // check getinput if SizingPeriod:DesignDays or SizingPeriod:WeatherFileDays are present
     185           91 :     if (state.dataGlobal->DoZoneSizing && (state.dataSize->NumZoneSizingInput > 0) && fileHasSizingPeriodDays) {
     186           49 :         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           42 :         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           91 :     if (state.dataGlobal->CompLoadReportIsReq) { // if that report is created then zone sizing calculations are repeated
     203            6 :         numZoneSizeIter = 2;
     204              :     } else {
     205           85 :         numZoneSizeIter = 1;
     206              :     }
     207              : 
     208           91 :     if ((state.dataGlobal->DoZoneSizing) && (state.dataSize->NumZoneSizingInput == 0)) {
     209            0 :         ShowWarningError(
     210              :             state,
     211            0 :             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          140 :     if ((state.dataSize->NumZoneSizingInput > 0) &&
     216           49 :         (state.dataGlobal->DoZoneSizing || state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing)) {
     217              : 
     218           49 :         state.dataGlobal->DoOutputReporting = false;
     219           49 :         state.dataGlobal->ZoneSizingCalc = true;
     220           49 :         Available = true;
     221              : 
     222           98 :         ShowMessage(state, "Beginning Zone Sizing Calculations");
     223              : 
     224           49 :         Weather::ResetEnvironmentCounter(state);
     225           49 :         state.dataGlobal->KickOffSizing = true;
     226           49 :         SetupZoneSizing(state, ErrorsFound); // Should only be done ONCE
     227           49 :         state.dataGlobal->KickOffSizing = false;
     228              : 
     229          104 :         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           55 :             state.dataGlobal->isPulseZoneSizing = (state.dataGlobal->CompLoadReportIsReq && (iZoneCalcIter == 1));
     238           55 :             if (state.dataGlobal->DoPureLoadCalc && !state.dataGlobal->isPulseZoneSizing) {
     239            9 :                 state.dataGlobal->DoOutputReporting = true;
     240              :             }
     241              : 
     242           55 :             Available = true;
     243              : 
     244           55 :             Weather::ResetEnvironmentCounter(state);
     245           55 :             state.dataSize->CurOverallSimDay = 0;
     246           55 :             NumSizingPeriodsPerformed = 0;
     247          157 :             while (Available) { // loop over environments
     248              : 
     249          157 :                 Weather::GetNextEnvironment(state, Available, ErrorsFound); // get an environment
     250              : 
     251          157 :                 if (!Available) {
     252           55 :                     break;
     253              :                 }
     254          102 :                 if (ErrorsFound) {
     255            0 :                     break;
     256              :                 }
     257              : 
     258              :                 // check that environment is one of the design days
     259          102 :                 if (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) {
     260            0 :                     continue;
     261              :                 }
     262              : 
     263          102 :                 ++NumSizingPeriodsPerformed;
     264              : 
     265          102 :                 if (state.dataGlobal->DoPureLoadCalc && !state.dataGlobal->isPulseZoneSizing) {
     266           18 :                     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          102 :                 state.dataGlobal->BeginEnvrnFlag = true;
     275          102 :                 state.dataGlobal->EndEnvrnFlag = false;
     276          102 :                 state.dataEnvrn->EndMonthFlag = false;
     277          102 :                 state.dataGlobal->WarmupFlag = true;
     278          102 :                 state.dataGlobal->DayOfSim = 0;
     279          102 :                 state.dataGlobal->DayOfSimChr = "0";
     280          102 :                 state.dataSize->CurEnvirNumSimDay = 1;
     281          102 :                 ++state.dataSize->CurOverallSimDay;
     282          938 :                 while ((state.dataGlobal->DayOfSim < state.dataGlobal->NumOfDayInEnvrn) || (state.dataGlobal->WarmupFlag)) { // Begin day loop ...
     283              : 
     284          734 :                     ++state.dataGlobal->DayOfSim;
     285          734 :                     if (!state.dataGlobal->WarmupFlag && state.dataGlobal->DayOfSim > 1) {
     286            0 :                         ++state.dataSize->CurEnvirNumSimDay;
     287              :                     }
     288              : 
     289          734 :                     state.dataGlobal->DayOfSimChr = fmt::to_string(state.dataGlobal->DayOfSim);
     290          734 :                     state.dataGlobal->BeginDayFlag = true;
     291          734 :                     state.dataGlobal->EndDayFlag = false;
     292              : 
     293          734 :                     if (state.dataGlobal->WarmupFlag) {
     294          632 :                         DisplayString(state, "Warming up");
     295              :                     } else { // (.NOT.WarmupFlag)
     296          102 :                         if (state.dataGlobal->DayOfSim == 1) {
     297          102 :                             if (!state.dataGlobal->isPulseZoneSizing) {
     298           90 :                                 DisplayString(state, "Performing Zone Sizing Simulation");
     299              :                             } else {
     300           12 :                                 DisplayString(state, "Performing Zone Sizing Simulation for Load Component Report");
     301              :                             }
     302          102 :                             DisplayString(state,
     303          204 :                                           fmt::format("...for Sizing Period: #{} {}", NumSizingPeriodsPerformed, state.dataEnvrn->EnvironmentName));
     304              :                         }
     305          102 :                         UpdateZoneSizing(state, Constant::CallIndicator::BeginDay);
     306          102 :                         UpdateFacilitySizing(state, Constant::CallIndicator::BeginDay);
     307              :                     }
     308              : 
     309        18350 :                     for (state.dataGlobal->HourOfDay = 1; state.dataGlobal->HourOfDay <= Constant::iHoursInDay;
     310        17616 :                          ++state.dataGlobal->HourOfDay) { // Begin hour loop ...
     311              : 
     312        17616 :                         state.dataGlobal->BeginHourFlag = true;
     313        17616 :                         state.dataGlobal->EndHourFlag = false;
     314              : 
     315       100368 :                         for (state.dataGlobal->TimeStep = 1; state.dataGlobal->TimeStep <= state.dataGlobal->TimeStepsInHour;
     316        82752 :                              ++state.dataGlobal->TimeStep) { // Begin time step (TINC) loop ...
     317              : 
     318        82752 :                             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        82752 :                             if (state.dataGlobal->TimeStep == state.dataGlobal->TimeStepsInHour) {
     328        17616 :                                 state.dataGlobal->EndHourFlag = true;
     329        17616 :                                 if (state.dataGlobal->HourOfDay == Constant::iHoursInDay) {
     330          734 :                                     state.dataGlobal->EndDayFlag = true;
     331          734 :                                     if ((!state.dataGlobal->WarmupFlag) && (state.dataGlobal->DayOfSim == state.dataGlobal->NumOfDayInEnvrn)) {
     332          102 :                                         state.dataGlobal->EndEnvrnFlag = true;
     333              :                                     }
     334              :                                 }
     335              :                             }
     336              : 
     337              :                             // set flag for pulse used in load component reporting
     338        82752 :                             state.dataGlobal->doLoadComponentPulseNow = CalcdoLoadComponentPulseNow(state,
     339        82752 :                                                                                                     state.dataGlobal->isPulseZoneSizing,
     340        82752 :                                                                                                     state.dataGlobal->WarmupFlag,
     341        82752 :                                                                                                     state.dataGlobal->HourOfDay,
     342        82752 :                                                                                                     state.dataGlobal->TimeStep,
     343        82752 :                                                                                                     state.dataGlobal->KindOfSim);
     344              : 
     345        82752 :                             Weather::ManageWeather(state);
     346              : 
     347        82752 :                             if (!state.dataGlobal->WarmupFlag) {
     348        12000 :                                 TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->TimeStepsInHour + state.dataGlobal->TimeStep;
     349        12000 :                                 if (state.dataGlobal->HourOfDay == 1 && state.dataGlobal->TimeStep == 1) {
     350          102 :                                     state.dataSize->DesDayWeath(state.dataSize->CurOverallSimDay).DateString =
     351          306 :                                         fmt::format("{}/{}", state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth);
     352              :                                 }
     353        12000 :                                 state.dataSize->DesDayWeath(state.dataSize->CurOverallSimDay).Temp(TimeStepInDay) = state.dataEnvrn->OutDryBulbTemp;
     354        12000 :                                 state.dataSize->DesDayWeath(state.dataSize->CurOverallSimDay).HumRat(TimeStepInDay) = state.dataEnvrn->OutHumRat;
     355        12000 :                                 state.dataSize->DesDayWeath(state.dataSize->CurOverallSimDay).Press(TimeStepInDay) = state.dataEnvrn->OutBaroPress;
     356              :                             }
     357              : 
     358        82752 :                             ManageHeatBalance(state);
     359              : 
     360        82752 :                             state.dataGlobal->BeginHourFlag = false;
     361        82752 :                             state.dataGlobal->BeginDayFlag = false;
     362        82752 :                             state.dataGlobal->BeginEnvrnFlag = false;
     363        82752 :                             state.dataGlobal->BeginSimFlag = false;
     364              : 
     365              :                         } // ... End time step (TINC) loop.
     366              : 
     367        17616 :                         state.dataGlobal->PreviousHour = state.dataGlobal->HourOfDay;
     368              : 
     369              :                     } // ... End hour loop.
     370              : 
     371          734 :                     if (state.dataGlobal->EndDayFlag && !state.dataGlobal->WarmupFlag) {
     372          204 :                         UpdateZoneSizing(state, Constant::CallIndicator::EndDay);
     373          204 :                         UpdateFacilitySizing(state, Constant::CallIndicator::EndDay);
     374              :                     }
     375              : 
     376          836 :                     if (!state.dataGlobal->WarmupFlag && (state.dataGlobal->DayOfSim > 0) &&
     377          102 :                         (state.dataGlobal->DayOfSim < state.dataGlobal->NumOfDayInEnvrn)) {
     378            0 :                         ++state.dataSize->CurOverallSimDay;
     379              :                     }
     380              : 
     381              :                 } // ... End day loop.
     382              : 
     383          102 :                 LastMonth = state.dataEnvrn->Month;
     384          102 :                 LastDayOfMonth = state.dataEnvrn->DayOfMonth;
     385              : 
     386              :             } // ... End environment loop
     387              : 
     388           55 :             if (NumSizingPeriodsPerformed > 0) {
     389           55 :                 UpdateZoneSizing(state, Constant::CallIndicator::EndZoneSizingCalc);
     390           55 :                 UpdateFacilitySizing(state, Constant::CallIndicator::EndZoneSizingCalc);
     391           55 :                 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           55 :             if (state.dataGlobal->isPulseZoneSizing && state.dataSizingManager->runZeroingOnce) {
     398            6 :                 RezeroZoneSizingArrays(state); // zero all arrays related to zone sizing.
     399            6 :                 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           49 :         if (state.dataGlobal->CompLoadReportIsReq) {
     405              :             // call the routine that computes the decay curve
     406            6 :             ComputeLoadComponentDecayCurve(state);
     407              :             // remove some of the arrays used to derive the decay curves
     408            6 :             DeallocateLoadComponentArrays(state);
     409              :         }
     410              :     }
     411              : 
     412           91 :     state.dataGlobal->ZoneSizingCalc = false;
     413           91 :     state.dataGlobal->DoOutputReporting = false;
     414           91 :     state.dataEnvrn->Month = LastMonth;
     415           91 :     state.dataEnvrn->DayOfMonth = LastDayOfMonth;
     416              : 
     417           91 :     if ((state.dataGlobal->DoSystemSizing) && (state.dataSize->NumSysSizInput == 0) && (state.dataSizingManager->NumAirLoops > 0)) {
     418            0 :         ShowWarningError(
     419              :             state,
     420            0 :             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           91 :     if ((state.dataSize->NumSysSizInput > 0) && (state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing) && !ErrorsFound) {
     425              : 
     426           56 :         ShowMessage(state, "Beginning System Sizing Calculations");
     427              : 
     428           28 :         state.dataGlobal->SysSizingCalc = true;
     429           28 :         Available = true;
     430           28 :         if (state.dataSize->SizingFileColSep == CharComma) {
     431           28 :             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           56 :         state.files.ssz.ensure_open(state, "ManageSizing", state.files.outputControl.ssz);
     438              : 
     439           28 :         SimAir = true;
     440           28 :         SimZoneEquip = true;
     441              : 
     442           28 :         ManageZoneEquipment(state, true, SimZoneEquip, SimAir);
     443           28 :         ManageAirLoops(state, true, SimAir, SimZoneEquip);
     444           28 :         SizingManager::UpdateTermUnitFinalZoneSizing(state); // AirDistUnits have been loaded now so TermUnitSizing values are all in place
     445           28 :         SimAirServingZones::SizeSysOutdoorAir(state);        // System OA can be sized now that TermUnitFinalZoneSizing is initialized
     446           28 :         Weather::ResetEnvironmentCounter(state);
     447           28 :         state.dataSize->CurEnvirNumSimDay = 0;
     448           28 :         state.dataSize->CurOverallSimDay = 0;
     449           28 :         NumSizingPeriodsPerformed = 0;
     450           95 :         while (Available) { // loop over environments
     451              : 
     452           81 :             Weather::GetNextEnvironment(state, Available, ErrorsFound); // get an environment
     453              : 
     454              :             // check that environment is one of the design days
     455           81 :             if (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) {
     456           14 :                 continue;
     457              :             }
     458              : 
     459           67 :             if (!Available) {
     460           14 :                 break;
     461              :             }
     462           53 :             if (ErrorsFound) {
     463            0 :                 break;
     464              :             }
     465              : 
     466           53 :             ++NumSizingPeriodsPerformed;
     467              : 
     468           53 :             state.dataGlobal->BeginEnvrnFlag = true;
     469           53 :             state.dataGlobal->EndEnvrnFlag = false;
     470           53 :             state.dataGlobal->WarmupFlag = false;
     471           53 :             state.dataGlobal->DayOfSim = 0;
     472           53 :             state.dataGlobal->DayOfSimChr = "0";
     473           53 :             state.dataSize->CurEnvirNumSimDay = 1;
     474           53 :             ++state.dataSize->CurOverallSimDay;
     475              : 
     476          159 :             while ((state.dataGlobal->DayOfSim < state.dataGlobal->NumOfDayInEnvrn) || (state.dataGlobal->WarmupFlag)) { // Begin day loop ...
     477              : 
     478           53 :                 ++state.dataGlobal->DayOfSim;
     479           53 :                 if (!state.dataGlobal->WarmupFlag && state.dataGlobal->DayOfSim > 1) {
     480            0 :                     ++state.dataSize->CurEnvirNumSimDay;
     481              :                 }
     482           53 :                 state.dataGlobal->DayOfSimChr = fmt::to_string(state.dataGlobal->DayOfSim);
     483           53 :                 state.dataGlobal->BeginDayFlag = true;
     484           53 :                 state.dataGlobal->EndDayFlag = false;
     485              : 
     486           53 :                 if (state.dataGlobal->WarmupFlag) {
     487            0 :                     DisplayString(state, "Warming up");
     488              :                 } else { // (.NOT.WarmupFlag)
     489           53 :                     if (state.dataGlobal->DayOfSim == 1) {
     490           53 :                         DisplayString(state, "Calculating System sizing");
     491           53 :                         DisplayString(state,
     492          106 :                                       fmt::format("...for Sizing Period: #{} {}", NumSizingPeriodsPerformed, state.dataEnvrn->EnvironmentName));
     493              :                     }
     494           53 :                     UpdateSysSizing(state, Constant::CallIndicator::BeginDay);
     495              :                 }
     496              : 
     497         1325 :                 for (state.dataGlobal->HourOfDay = 1; state.dataGlobal->HourOfDay <= Constant::iHoursInDay;
     498         1272 :                      ++state.dataGlobal->HourOfDay) { // Begin hour loop ...
     499              : 
     500         1272 :                     state.dataGlobal->BeginHourFlag = true;
     501         1272 :                     state.dataGlobal->EndHourFlag = false;
     502              : 
     503         7368 :                     for (state.dataGlobal->TimeStep = 1; state.dataGlobal->TimeStep <= state.dataGlobal->TimeStepsInHour;
     504         6096 :                          ++state.dataGlobal->TimeStep) { // Begin time step (TINC) loop ...
     505              : 
     506         6096 :                         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         6096 :                         if (state.dataGlobal->TimeStep == state.dataGlobal->TimeStepsInHour) {
     514         1272 :                             state.dataGlobal->EndHourFlag = true;
     515         1272 :                             if (state.dataGlobal->HourOfDay == Constant::iHoursInDay) {
     516           53 :                                 state.dataGlobal->EndDayFlag = true;
     517           53 :                                 if ((!state.dataGlobal->WarmupFlag) && (state.dataGlobal->DayOfSim == state.dataGlobal->NumOfDayInEnvrn)) {
     518           53 :                                     state.dataGlobal->EndEnvrnFlag = true;
     519              :                                 }
     520              :                             }
     521              :                         }
     522              : 
     523         6096 :                         Weather::ManageWeather(state);
     524              : 
     525         6096 :                         UpdateSysSizing(state, Constant::CallIndicator::DuringDay);
     526              : 
     527         6096 :                         state.dataGlobal->BeginHourFlag = false;
     528         6096 :                         state.dataGlobal->BeginDayFlag = false;
     529         6096 :                         state.dataGlobal->BeginEnvrnFlag = false;
     530              : 
     531              :                     } // ... End time step (TINC) loop.
     532              : 
     533         1272 :                     state.dataGlobal->PreviousHour = state.dataGlobal->HourOfDay;
     534              : 
     535              :                 } // ... End hour loop.
     536              : 
     537           53 :                 if (state.dataGlobal->EndDayFlag) {
     538           53 :                     UpdateSysSizing(state, Constant::CallIndicator::EndDay);
     539              :                 }
     540              : 
     541          106 :                 if (!state.dataGlobal->WarmupFlag && (state.dataGlobal->DayOfSim > 0) &&
     542           53 :                     (state.dataGlobal->DayOfSim < state.dataGlobal->NumOfDayInEnvrn)) {
     543            0 :                     ++state.dataSize->CurOverallSimDay;
     544              :                 }
     545              : 
     546              :             } // ... End day loop.
     547              : 
     548              :         } // ... End environment loop
     549              : 
     550           28 :         if (NumSizingPeriodsPerformed > 0) {
     551           28 :             UpdateSysSizing(state, Constant::CallIndicator::EndSysSizingCalc);
     552           28 :             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           84 :     } else if ((state.dataSize->NumZoneSizingInput > 0) &&
     558           21 :                (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           21 :         state.dataGlobal->SysSizingCalc = true; // set true here so equipment does not try to size yet
     562           21 :         SimAir = true;
     563           21 :         SimZoneEquip = true;
     564              : 
     565           21 :         ManageZoneEquipment(state, true, SimZoneEquip, SimAir);
     566           21 :         SizingManager::UpdateTermUnitFinalZoneSizing(state); // AirDistUnits have been loaded now so TermUnitSizing values are all in place
     567              :     }
     568           91 :     state.dataGlobal->SysSizingCalc = false;
     569              : 
     570              :     // report sizing results to eio file
     571           91 :     if (state.dataSize->ZoneSizingRunDone) {
     572           49 :         bool isSpace = true;
     573           49 :         if (state.dataHeatBal->doSpaceHeatBalanceSizing) {
     574           28 :             for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
     575           21 :                 if (!state.dataZoneEquip->ZoneEquipConfig(state.dataHeatBal->space(spaceNum).zoneNum).IsControlled) {
     576            0 :                     continue;
     577              :                 }
     578           42 :                 reportZoneSizing(state,
     579           21 :                                  state.dataHeatBal->space(spaceNum),
     580           21 :                                  state.dataSize->FinalSpaceSizing(spaceNum),
     581           21 :                                  state.dataSize->CalcFinalSpaceSizing(spaceNum),
     582           21 :                                  state.dataSize->CalcSpaceSizing,
     583           21 :                                  state.dataSize->SpaceSizing,
     584              :                                  isSpace);
     585              :             }
     586              :         }
     587           49 :         isSpace = false;
     588          128 :         for (int CtrlZoneNum = 1; CtrlZoneNum <= state.dataGlobal->NumOfZones; ++CtrlZoneNum) {
     589           79 :             if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum).IsControlled) {
     590            9 :                 continue;
     591              :             }
     592          140 :             reportZoneSizing(state,
     593           70 :                              state.dataHeatBal->Zone(CtrlZoneNum),
     594           70 :                              state.dataSize->FinalZoneSizing(CtrlZoneNum),
     595           70 :                              state.dataSize->CalcFinalZoneSizing(CtrlZoneNum),
     596           70 :                              state.dataSize->CalcZoneSizing,
     597           70 :                              state.dataSize->ZoneSizing,
     598              :                              isSpace);
     599              :         }
     600              :     }
     601              :     // Deallocate arrays no longer needed
     602           91 :     state.dataSize->ZoneSizing.deallocate();
     603              :     // CalcZoneSizing.deallocate();
     604           91 :     if (state.dataHeatBal->doSpaceHeatBalanceSizing) {
     605            7 :         state.dataSize->SpaceSizing.deallocate();
     606              :     }
     607              : 
     608           91 :     if (state.dataSize->SysSizingRunDone) {
     609           56 :         for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
     610           28 :             auto &calcSysSizing = state.dataSize->CalcSysSizing(AirLoopNum);
     611           28 :             auto &sysSizPeakDDNum = state.dataSize->SysSizPeakDDNum(AirLoopNum);
     612           28 :             auto &finalSysSizing = state.dataSize->FinalSysSizing(AirLoopNum);
     613              : 
     614           28 :             curName = finalSysSizing.AirPriLoopName;
     615           28 :             PreDefTableEntry(state, state.dataOutRptPredefined->pdchSysSizCalcClAir, curName, calcSysSizing.DesCoolVolFlow);
     616           28 :             if (std::abs(calcSysSizing.DesCoolVolFlow) <= 1.e-8) {
     617            2 :                 ShowWarningError(
     618            2 :                     state, format("{}Calculated Cooling Design Air Flow Rate for System={} is zero.", RoutineName, finalSysSizing.AirPriLoopName));
     619            3 :                 ShowContinueError(state, "Check Sizing:Zone and ZoneControl:Thermostat inputs.");
     620              :             }
     621           28 :             PreDefTableEntry(state, state.dataOutRptPredefined->pdchSysSizUserClAir, curName, finalSysSizing.DesCoolVolFlow);
     622           28 :             PreDefTableEntry(state, state.dataOutRptPredefined->pdchSysSizCalcHtAir, curName, calcSysSizing.DesHeatVolFlow);
     623           28 :             if (std::abs(calcSysSizing.DesHeatVolFlow) <= 1.e-8) {
     624            2 :                 ShowWarningError(
     625            2 :                     state, format("{}Calculated Heating Design Air Flow Rate for System={} is zero.", RoutineName, finalSysSizing.AirPriLoopName));
     626            3 :                 ShowContinueError(state, "Check Sizing:Zone and ZoneControl:Thermostat inputs.");
     627              :             }
     628           28 :             std::string_view coolPeakLoadKind;
     629           28 :             std::string coolPeakDDDate;
     630           28 :             int coolPeakDD = 0;
     631           28 :             Real64 coolCap = 0.;
     632           28 :             int timeStepIndexAtPeakCoolLoad = 0;
     633           28 :             if (finalSysSizing.coolingPeakLoad == DataSizing::PeakLoad::SensibleCooling) {
     634           27 :                 coolPeakLoadKind = "Sensible";
     635           27 :                 coolPeakDDDate = sysSizPeakDDNum.cSensCoolPeakDDDate;
     636           27 :                 coolPeakDD = sysSizPeakDDNum.SensCoolPeakDD;
     637           27 :                 coolCap = finalSysSizing.SensCoolCap;
     638           27 :                 if (coolPeakDD > 0) {
     639           24 :                     timeStepIndexAtPeakCoolLoad = sysSizPeakDDNum.TimeStepAtSensCoolPk(coolPeakDD);
     640              :                 }
     641            1 :             } else if (finalSysSizing.coolingPeakLoad == DataSizing::PeakLoad::TotalCooling) {
     642            1 :                 if (finalSysSizing.loadSizingType == DataSizing::LoadSizing::Latent && state.dataHeatBal->DoLatentSizing) {
     643            0 :                     coolPeakLoadKind = "Total Based on Latent";
     644              :                 } else {
     645            1 :                     coolPeakLoadKind = "Total";
     646              :                 }
     647            1 :                 coolPeakDDDate = sysSizPeakDDNum.cTotCoolPeakDDDate;
     648            1 :                 coolPeakDD = sysSizPeakDDNum.TotCoolPeakDD;
     649            1 :                 coolCap = finalSysSizing.TotCoolCap;
     650            1 :                 if (coolPeakDD > 0) {
     651            1 :                     timeStepIndexAtPeakCoolLoad = sysSizPeakDDNum.TimeStepAtTotCoolPk(coolPeakDD);
     652              :                 }
     653              :             }
     654           28 :             if (coolPeakDD > 0) {
     655           25 :                 ReportSysSizing(state,
     656              :                                 curName,
     657              :                                 "Cooling",
     658              :                                 coolPeakLoadKind,
     659              :                                 coolCap,
     660              :                                 calcSysSizing.DesCoolVolFlow,
     661              :                                 finalSysSizing.DesCoolVolFlow,
     662           25 :                                 finalSysSizing.CoolDesDay,
     663              :                                 coolPeakDDDate,
     664              :                                 timeStepIndexAtPeakCoolLoad);
     665              :             } else {
     666            3 :                 ReportSysSizing(state,
     667              :                                 curName,
     668              :                                 "Cooling",
     669              :                                 coolPeakLoadKind,
     670              :                                 coolCap,
     671              :                                 calcSysSizing.DesCoolVolFlow,
     672              :                                 finalSysSizing.DesCoolVolFlow,
     673            3 :                                 finalSysSizing.CoolDesDay,
     674              :                                 coolPeakDDDate,
     675              :                                 0);
     676              :             }
     677           28 :             int heatPeakDD = sysSizPeakDDNum.HeatPeakDD;
     678           28 :             if (heatPeakDD > 0) {
     679           24 :                 ReportSysSizing(state,
     680              :                                 curName,
     681              :                                 "Heating",
     682              :                                 "Sensible",
     683              :                                 finalSysSizing.HeatCap,
     684              :                                 calcSysSizing.DesHeatVolFlow,
     685              :                                 finalSysSizing.DesHeatVolFlow,
     686           24 :                                 finalSysSizing.HeatDesDay,
     687           24 :                                 sysSizPeakDDNum.cHeatPeakDDDate,
     688           24 :                                 sysSizPeakDDNum.TimeStepAtHeatPk(heatPeakDD));
     689              :             } else {
     690            4 :                 ReportSysSizing(state,
     691              :                                 curName,
     692              :                                 "Heating",
     693              :                                 "Sensible",
     694              :                                 finalSysSizing.HeatCap,
     695              :                                 calcSysSizing.DesHeatVolFlow,
     696              :                                 finalSysSizing.DesHeatVolFlow,
     697            4 :                                 finalSysSizing.HeatDesDay,
     698            4 :                                 sysSizPeakDDNum.cHeatPeakDDDate,
     699              :                                 0);
     700              :             }
     701           28 :             PreDefTableEntry(state, state.dataOutRptPredefined->pdchSysSizUserHtAir, curName, finalSysSizing.DesHeatVolFlow);
     702           28 :         }
     703              :         // Deallocate arrays no longer needed
     704           28 :         state.dataSize->SysSizing.deallocate();
     705              :     }
     706              : 
     707              :     // Size SpaceHVAC fractions
     708           91 :     if (state.dataHeatBal->doSpaceHeatBalanceSimulation) {
     709            0 :         for (auto &thisSpaceHVACSplitter : state.dataZoneEquip->zoneEquipSplitter) {
     710            0 :             thisSpaceHVACSplitter.size(state);
     711            0 :         }
     712            0 :         for (auto &thisSpaceHVACMixer : state.dataZoneEquip->zoneEquipMixer) {
     713            0 :             thisSpaceHVACMixer.size(state);
     714            0 :         }
     715              :     }
     716              : 
     717           91 :     if ((state.dataGlobal->DoPlantSizing) && (state.dataSize->NumPltSizInput == 0)) {
     718            0 :         ShowWarningError(
     719              :             state,
     720            0 :             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           91 :     if ((state.dataSize->NumPltSizInput > 0) && (state.dataGlobal->DoPlantSizing) && !ErrorsFound) {
     725              : 
     726           21 :         ShowMessage(state, "Beginning Plant Sizing Calculations");
     727              :     }
     728              : 
     729           91 :     if (ErrorsFound) {
     730            0 :         ShowFatalError(state, "Program terminates due to preceding conditions.");
     731              :     }
     732           91 : }
     733              : 
     734        82760 : 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        82760 :     int constexpr HourDayToPulse(10);
     747        82760 :     int constexpr TimeStepToPulse(1);
     748              : 
     749        82774 :     if ((isPulseZoneSizing) && (!WarmupFlag) && (HourOfDay == HourDayToPulse) && (TimeStep == TimeStepToPulse) &&
     750           14 :         ((KindOfSim == Constant::KindOfSim::RunPeriodDesign) || (state.dataGlobal->DayOfSim == 1))) {
     751           14 :         return true;
     752              :     } else {
     753        82746 :         return false;
     754              :     }
     755              : }
     756              : 
     757           74 : 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           74 :     auto &sd_airterminal = state.dataSingleDuct->sd_airterminal;
     769              : 
     770           74 :     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           19 :         bool t_SimZoneEquip(true);
     774           19 :         bool t_SimAir(false);
     775           19 :         state.dataGlobal->BeginEnvrnFlag = true; // trigger begin envrn blocks in zone equipment models
     776           19 :         ZoneEquipmentManager::ManageZoneEquipment(state, true, t_SimZoneEquip, t_SimAir);
     777           19 :         state.dataGlobal->BeginEnvrnFlag = false;
     778              : 
     779           38 :         for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
     780           19 :             auto &finalSysSizing = state.dataSize->FinalSysSizing(AirLoopNum);
     781              :             // Mine data from ATUs to find new design heating flow rates and new maximum flow rates
     782           19 :             Real64 airLoopMaxFlowRateSum(0.0);
     783           19 :             Real64 airLoopHeatingMinimumFlowRateSum(0.0);
     784           19 :             Real64 airLoopHeatingMaximumFlowRateSum(0.0);
     785              : 
     786              :             // sum up heating and max flows for any single duct systems, store 62.1 values by zone
     787           19 :             if (allocated(sd_airterminal) && state.dataSingleDuct->NumSDAirTerminal > 0) {
     788           41 :                 for (int singleDuctATUNum = 1; singleDuctATUNum <= state.dataSingleDuct->NumSDAirTerminal; ++singleDuctATUNum) {
     789           24 :                     auto const &airDistUnit = state.dataDefineEquipment->AirDistUnit(sd_airterminal(singleDuctATUNum).ADUNum);
     790           24 :                     if (AirLoopNum == sd_airterminal(singleDuctATUNum).AirLoopNum) {
     791           24 :                         int termUnitSizingIndex = airDistUnit.TermUnitSizingNum;
     792           24 :                         airLoopMaxFlowRateSum += sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate;
     793              : 
     794           24 :                         state.dataSize->VpzClgByZone(termUnitSizingIndex) =
     795           24 :                             sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
     796              : 
     797           48 :                         if (sd_airterminal(singleDuctATUNum).SysType_Num == SingleDuct::SysType::SingleDuctConstVolReheat ||
     798           24 :                             sd_airterminal(singleDuctATUNum).SysType_Num == SingleDuct::SysType::SingleDuctConstVolNoReheat) {
     799            6 :                             airLoopHeatingMinimumFlowRateSum += sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate;
     800            6 :                             airLoopHeatingMaximumFlowRateSum += sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate;
     801              : 
     802            6 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     803            6 :                                 sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
     804            6 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) =
     805            6 :                                 sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
     806            6 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
     807            6 :                                 sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
     808              : 
     809              :                         } else {
     810           18 :                             airLoopHeatingMinimumFlowRateSum +=
     811           18 :                                 sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * sd_airterminal(singleDuctATUNum).ZoneMinAirFrac;
     812           18 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) =
     813           18 :                                 sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate *
     814           18 :                                 sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; // store std 62.1 values
     815           18 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
     816           18 :                                 sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate *
     817           18 :                                 sd_airterminal(singleDuctATUNum).ZoneMinAirFrac;                // store std 62.1 values
     818           18 :                             if (sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate > 0.0) { // VS fan ATU has this non zero, so use it
     819            0 :                                 airLoopHeatingMaximumFlowRateSum += sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate;
     820            0 :                                 state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     821            0 :                                     sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate; // store std 62.1 values
     822              :                             } else {
     823           18 :                                 if (sd_airterminal(singleDuctATUNum).DamperHeatingAction == SingleDuct::Action::Reverse) {
     824            0 :                                     airLoopHeatingMaximumFlowRateSum += sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate;
     825            0 :                                     state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     826            0 :                                         sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
     827           18 :                                 } else if (sd_airterminal(singleDuctATUNum).DamperHeatingAction == SingleDuct::Action::ReverseWithLimits) {
     828            4 :                                     airLoopHeatingMaximumFlowRateSum +=
     829            4 :                                         max(sd_airterminal(singleDuctATUNum).MaxAirVolFlowRateDuringReheat,
     830            4 :                                             (sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * sd_airterminal(singleDuctATUNum).ZoneMinAirFrac));
     831            4 :                                     state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     832            4 :                                         max(sd_airterminal(singleDuctATUNum).MaxAirVolFlowRateDuringReheat,
     833            4 :                                             (sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate *
     834            4 :                                              sd_airterminal(singleDuctATUNum).ZoneMinAirFrac)); // store std 62.1 values
     835              :                                 } else {
     836           14 :                                     airLoopHeatingMaximumFlowRateSum +=
     837           14 :                                         sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * sd_airterminal(singleDuctATUNum).ZoneMinAirFrac;
     838           14 :                                     state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     839           14 :                                         sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate *
     840           14 :                                         sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; // store std 62.1 values
     841              :                                 }
     842              :                             }
     843              :                         }
     844              :                         // single-path air terminal so Vdz = Vpz
     845           24 :                         state.dataSize->VdzClgByZone(termUnitSizingIndex) =
     846           24 :                             state.dataSize->VpzClgByZone(termUnitSizingIndex); // store std 62.1 values
     847           24 :                         state.dataSize->VdzMinClgByZone(termUnitSizingIndex) =
     848           24 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex); // store std 62.1 values
     849           24 :                         state.dataSize->VdzHtgByZone(termUnitSizingIndex) =
     850           24 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex); // store std 62.1 values
     851           24 :                         state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) =
     852           24 :                             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           19 :             if (allocated(state.dataDualDuct->dd_airterminal) && state.dataDualDuct->NumDDAirTerminal > 0) {
     859            0 :                 for (int dualDuctATUNum = 1; dualDuctATUNum <= state.dataDualDuct->NumDDAirTerminal; ++dualDuctATUNum) {
     860            0 :                     if (AirLoopNum == state.dataDualDuct->dd_airterminal(dualDuctATUNum).AirLoopNum) {
     861            0 :                         auto const &airDistUnit = state.dataDefineEquipment->AirDistUnit(state.dataDualDuct->dd_airterminal(dualDuctATUNum).ADUNum);
     862            0 :                         int termUnitSizingIndex = airDistUnit.TermUnitSizingNum;
     863            0 :                         airLoopMaxFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
     864            0 :                         state.dataSize->VpzClgByZone(termUnitSizingIndex) =
     865            0 :                             state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
     866              : 
     867            0 :                         if (state.dataDualDuct->dd_airterminal(dualDuctATUNum).DamperType == DualDuct::DualDuctDamper::ConstantVolume) {
     868            0 :                             airLoopHeatingMaximumFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
     869            0 :                             airLoopHeatingMinimumFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
     870            0 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) =
     871            0 :                                 state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
     872            0 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     873            0 :                                 state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
     874            0 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
     875            0 :                                 state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
     876            0 :                             state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataSize->VpzClgByZone(termUnitSizingIndex);
     877            0 :                             state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = state.dataSize->VpzMinClgByZone(termUnitSizingIndex);
     878            0 :                             state.dataSize->VdzHtgByZone(termUnitSizingIndex) = state.dataSize->VpzHtgByZone(termUnitSizingIndex);
     879            0 :                             state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
     880              : 
     881            0 :                         } 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            0 :                         } else if (state.dataDualDuct->dd_airterminal(dualDuctATUNum).DamperType == DualDuct::DualDuctDamper::OutdoorAir) {
     898            0 :                             airLoopHeatingMaximumFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
     899              :                             // Calculate the design OA flow rate for this zone
     900            0 :                             bool UseOccSchFlag = false;
     901            0 :                             bool UseMinOASchFlag = false;
     902            0 :                             Real64 designOAductFlow(0.0);
     903              :                             designOAductFlow =
     904            0 :                                 DataSizing::calcDesignSpecificationOutdoorAir(state,
     905            0 :                                                                               state.dataDualDuct->dd_airterminal(dualDuctATUNum).OARequirementsPtr,
     906            0 :                                                                               state.dataDualDuct->dd_airterminal(dualDuctATUNum).CtrlZoneNum,
     907              :                                                                               UseOccSchFlag,
     908              :                                                                               UseMinOASchFlag);
     909            0 :                             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            0 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = designOAductFlow; // not sure about this
     913            0 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex) = designOAductFlow;    // no heating for this terminal
     914            0 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = designOAductFlow;
     915            0 :                             state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
     916            0 :                             state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = designOAductFlow;
     917            0 :                             state.dataSize->VdzHtgByZone(termUnitSizingIndex) = designOAductFlow;
     918            0 :                             state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = designOAductFlow;
     919              :                         }
     920              :                     }
     921              :                 }
     922              :             }
     923              : 
     924              :             // sum up heating and max flows for any PIU air terminals
     925           19 :             if (allocated(state.dataPowerInductionUnits->PIU) && state.dataPowerInductionUnits->NumPIUs > 0) {
     926           12 :                 for (int pIUATUNum = 1; pIUATUNum <= state.dataPowerInductionUnits->NumPIUs; ++pIUATUNum) {
     927            6 :                     auto const &airDistUnit = state.dataDefineEquipment->AirDistUnit(state.dataPowerInductionUnits->PIU(pIUATUNum).ADUNum);
     928            6 :                     if (AirLoopNum == state.dataPowerInductionUnits->PIU(pIUATUNum).AirLoopNum) {
     929            6 :                         int termUnitSizingIndex = airDistUnit.TermUnitSizingNum;
     930            6 :                         auto &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
     931            6 :                         airLoopMaxFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     932            6 :                         if (state.dataPowerInductionUnits->PIU(pIUATUNum).UnitType_Num ==
     933              :                             DataDefineEquip::ZnAirLoopEquipType::SingleDuct_SeriesPIU_Reheat) {
     934            6 :                             airLoopHeatingMaximumFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     935            6 :                                                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     936            6 :                             airLoopHeatingMinimumFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     937            6 :                                                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     938              : 
     939              :                             // dual path for std 62.1
     940            6 :                             state.dataSize->VpzClgByZone(termUnitSizingIndex) = state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     941           12 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     942            6 :                                                                                    state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     943            6 :                             state.dataSize->VdzClgByZone(termUnitSizingIndex) =
     944            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxTotAirVolFlow; // which is constant for series PIU
     945            6 :                             state.dataSize->VdzMinClgByZone(termUnitSizingIndex) =
     946            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum)
     947            6 :                                     .MaxTotAirVolFlow; // min dz is the same as max because series PIU has constant discharge volume
     948              : 
     949            6 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     950            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     951            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow; // runs at minimum primary for heating always
     952            6 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
     953            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     954            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow; // runs at minimum primary for heating always
     955            6 :                             state.dataSize->VdzHtgByZone(termUnitSizingIndex) =
     956            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxTotAirVolFlow; // which is constant for series PIU
     957            6 :                             state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) =
     958            6 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxTotAirVolFlow; // which is constant for series PIU
     959              : 
     960              :                             // store Ep for 62.1 calculations
     961            6 :                             thisTermUnitFinalZoneSizing.ZonePrimaryAirFraction =
     962            6 :                                 state.dataSize->VpzMinClgByZone(termUnitSizingIndex) /
     963            6 :                                 state.dataSize->VdzClgByZone(termUnitSizingIndex); // min primary divided by max total
     964            6 :                             thisTermUnitFinalZoneSizing.ZonePrimaryAirFractionHtg =
     965            6 :                                 state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) / state.dataSize->VdzHtgByZone(termUnitSizingIndex);
     966              : 
     967            0 :                         } else if (state.dataPowerInductionUnits->PIU(pIUATUNum).UnitType_Num ==
     968              :                                    DataDefineEquip::ZnAirLoopEquipType::SingleDuct_ParallelPIU_Reheat) {
     969            0 :                             airLoopHeatingMaximumFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     970            0 :                                                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     971            0 :                             airLoopHeatingMinimumFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     972            0 :                                                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     973              : 
     974              :                             // dual path for std 62.1
     975            0 :                             state.dataSize->VpzClgByZone(termUnitSizingIndex) = state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     976            0 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     977            0 :                                                                                    state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
     978            0 :                             state.dataSize->VdzClgByZone(termUnitSizingIndex) =
     979            0 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum)
     980            0 :                                     .MaxPriAirVolFlow; // for Parallel PIU expect Fan off during max cooling, so discharge is all primary
     981            0 :                             state.dataSize->VdzMinClgByZone(termUnitSizingIndex) =
     982            0 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     983            0 :                                     state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow +
     984            0 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum)
     985            0 :                                     .MaxSecAirVolFlow; // expect secondary fan to be running at min cooling, for reheat
     986              : 
     987            0 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
     988            0 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     989            0 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow; // primary at minimum
     990            0 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
     991            0 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     992            0 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow; // primary at minimum
     993            0 :                             state.dataSize->VdzHtgByZone(termUnitSizingIndex) =
     994            0 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     995            0 :                                     state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow +
     996            0 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxSecAirVolFlow; // expect min primary and CV fan running
     997            0 :                             state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) =
     998            0 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
     999            0 :                                     state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow +
    1000            0 :                                 state.dataPowerInductionUnits->PIU(pIUATUNum).MaxSecAirVolFlow; // expect min primary and CV fan running
    1001              : 
    1002            0 :                             thisTermUnitFinalZoneSizing.ZonePrimaryAirFraction =
    1003            0 :                                 state.dataSize->VpzMinClgByZone(termUnitSizingIndex) /
    1004            0 :                                 state.dataSize->VdzClgByZone(termUnitSizingIndex); // min primary divided by max total
    1005            0 :                             thisTermUnitFinalZoneSizing.ZonePrimaryAirFractionHtg =
    1006            0 :                                 state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) / state.dataSize->VdzHtgByZone(termUnitSizingIndex);
    1007              :                         }
    1008              :                     }
    1009              :                 }
    1010              :             }
    1011              : 
    1012           19 :             auto &IndUnit = state.dataHVACSingleDuctInduc->IndUnit;
    1013           19 :             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           19 :             if (allocated(IndUnit) && (NumIndUnits > 0)) {
    1018            0 :                 for (int indUnitNum = 1; indUnitNum <= NumIndUnits; ++indUnitNum) {
    1019            0 :                     auto const &airDistUnit = state.dataDefineEquipment->AirDistUnit(IndUnit(indUnitNum).ADUNum);
    1020            0 :                     if (AirLoopNum == IndUnit(indUnitNum).AirLoopNum) {
    1021            0 :                         int termUnitSizingIndex = airDistUnit.TermUnitSizingNum;
    1022            0 :                         airLoopHeatingMaximumFlowRateSum += IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1023            0 :                         airLoopHeatingMinimumFlowRateSum += IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1024            0 :                         airLoopMaxFlowRateSum += IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1025              :                         // store Std 62.1 values, CV system
    1026            0 :                         state.dataSize->VpzClgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1027            0 :                         state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1028            0 :                         state.dataSize->VdzClgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxTotAirVolFlow;
    1029            0 :                         state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxTotAirVolFlow;
    1030            0 :                         state.dataSize->VpzHtgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1031            0 :                         state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
    1032            0 :                         state.dataSize->VdzHtgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxTotAirVolFlow;
    1033            0 :                         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           19 :             if (allocated(state.dataHVACCooledBeam->CoolBeam) && (state.dataHVACCooledBeam->NumCB > 0)) {
    1040            0 :                 for (int coolBeamNum = 1; coolBeamNum <= state.dataHVACCooledBeam->NumCB; ++coolBeamNum) {
    1041            0 :                     auto const &airDistUnit = state.dataDefineEquipment->AirDistUnit(state.dataHVACCooledBeam->CoolBeam(coolBeamNum).ADUNum);
    1042            0 :                     if (AirLoopNum == state.dataHVACCooledBeam->CoolBeam(coolBeamNum).AirLoopNum) {
    1043            0 :                         int termUnitSizingIndex = airDistUnit.TermUnitSizingNum;
    1044            0 :                         airLoopHeatingMaximumFlowRateSum += state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1045            0 :                         airLoopHeatingMinimumFlowRateSum += state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1046            0 :                         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            0 :                         state.dataSize->VpzClgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1051            0 :                         state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1052            0 :                         state.dataSize->VpzHtgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1053            0 :                         state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1054            0 :                         state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1055            0 :                         state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1056            0 :                         state.dataSize->VdzHtgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
    1057            0 :                         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           19 :             if (allocated(state.dataDefineEquipment->AirDistUnit) && (int)state.dataDefineEquipment->AirDistUnit.size() > 0) {
    1064           51 :                 for (int aDUNum = 1; aDUNum <= (int)state.dataDefineEquipment->AirDistUnit.size(); ++aDUNum) {
    1065           32 :                     auto &airDistUnit = state.dataDefineEquipment->AirDistUnit(aDUNum);
    1066           32 :                     if (airDistUnit.airTerminalPtr.get() != nullptr) {
    1067            0 :                         if (AirLoopNum == airDistUnit.airTerminalPtr->getAirLoopNum()) {
    1068            0 :                             airLoopHeatingMaximumFlowRateSum += airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1069            0 :                             airLoopHeatingMinimumFlowRateSum += airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1070            0 :                             airLoopMaxFlowRateSum += airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1071              :                             // store Std 62.1 values, have no modeling of secondary flow rates for induced flow from beam
    1072            0 :                             int termUnitSizingIndex = airDistUnit.airTerminalPtr->getTermUnitSizingIndex();
    1073            0 :                             state.dataSize->VpzClgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1074            0 :                             state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1075            0 :                             state.dataSize->VpzHtgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1076            0 :                             state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1077            0 :                             state.dataSize->VdzClgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1078            0 :                             state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1079            0 :                             state.dataSize->VdzHtgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1080            0 :                             state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = airDistUnit.airTerminalPtr->getPrimAirDesignVolFlow();
    1081              :                         }
    1082              :                     }
    1083              :                 }
    1084              :             }
    1085              : 
    1086              :             // sum up flows for any air terminal mixers
    1087           19 :             if (allocated(state.dataSingleDuct->SysATMixer) && (state.dataSingleDuct->NumATMixers > 0)) {
    1088            3 :                 for (int aTMixerNum = 1; aTMixerNum <= state.dataSingleDuct->NumATMixers; ++aTMixerNum) {
    1089            2 :                     auto const &airDistUnit = state.dataDefineEquipment->AirDistUnit(state.dataSingleDuct->SysATMixer(aTMixerNum).ADUNum);
    1090            2 :                     if (AirLoopNum == state.dataSingleDuct->SysATMixer(aTMixerNum).AirLoopNum) {
    1091            2 :                         int termUnitSizingIndex = airDistUnit.TermUnitSizingNum;
    1092            2 :                         airLoopHeatingMaximumFlowRateSum += state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1093            2 :                         airLoopHeatingMinimumFlowRateSum += state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1094            2 :                         airLoopMaxFlowRateSum += state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1095              : 
    1096            2 :                         state.dataSize->VpzClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1097            2 :                         state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1098            2 :                         state.dataSize->VpzHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1099            2 :                         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            2 :                         state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1102            2 :                         state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1103            2 :                         state.dataSize->VdzHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1104            2 :                         state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
    1105              :                     }
    1106              :                 }
    1107              :             }
    1108              : 
    1109           19 :             std::string curName = finalSysSizing.AirPriLoopName;
    1110           19 :             BaseSizer::reportSizerOutput(
    1111              :                 state, "AirLoopHVAC", curName, "Sum of Air Terminal Maximum Heating Flow Rates [m3/s]", airLoopHeatingMaximumFlowRateSum);
    1112           19 :             BaseSizer::reportSizerOutput(
    1113              :                 state, "AirLoopHVAC", curName, "Sum of Air Terminal Minimum Heating Flow Rates [m3/s]", airLoopHeatingMinimumFlowRateSum);
    1114           19 :             BaseSizer::reportSizerOutput(state, "AirLoopHVAC", curName, "Sum of Air Terminal Maximum Flow Rates [m3/s]", airLoopMaxFlowRateSum);
    1115              : 
    1116              :             // Adjust system sizing info
    1117           19 :             if (allocated(state.dataSize->FinalSysSizing)) {
    1118              :                 // correct sizing design heating volume flow rate based on finalized air terminal unit operation
    1119              : 
    1120           19 :                 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           19 :                     finalSysSizing.DesHeatVolFlow = max(airLoopHeatingMaximumFlowRateSum, finalSysSizing.DesHeatVolFlow);
    1125           19 :                     finalSysSizing.DesMainVolFlow = max(airLoopMaxFlowRateSum, finalSysSizing.DesMainVolFlow);
    1126           19 :                     if (finalSysSizing.sysSizeCoolingDominant) {
    1127           14 :                         finalSysSizing.DesCoolVolFlow = finalSysSizing.DesMainVolFlow;
    1128           14 :                         finalSysSizing.MassFlowAtCoolPeak = finalSysSizing.DesCoolVolFlow * state.dataEnvrn->StdRhoAir;
    1129            5 :                     } else if (finalSysSizing.sysSizeHeatingDominant) { // make sure cooling is at least at minimum.
    1130            5 :                         finalSysSizing.DesCoolVolFlow = max(airLoopHeatingMinimumFlowRateSum, finalSysSizing.DesCoolVolFlow);
    1131            5 :                         finalSysSizing.MassFlowAtCoolPeak = finalSysSizing.DesCoolVolFlow * state.dataEnvrn->StdRhoAir;
    1132              :                     }
    1133            0 :                 } else if (finalSysSizing.SizingOption == DataSizing::SizingConcurrence::Coincident) {
    1134              : 
    1135            0 :                     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            0 :                         finalSysSizing.DesHeatVolFlow = max(airLoopHeatingMinimumFlowRateSum, finalSysSizing.DesHeatVolFlow);
    1139            0 :                         finalSysSizing.DesMainVolFlow = max(airLoopHeatingMinimumFlowRateSum, finalSysSizing.DesMainVolFlow);
    1140            0 :                         finalSysSizing.DesCoolVolFlow = finalSysSizing.DesMainVolFlow;
    1141            0 :                         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           19 :                 BaseSizer::reportSizerOutput(
    1152              :                     state, "AirLoopHVAC", curName, "Adjusted Heating Design Air Flow Rate [m3/s]", finalSysSizing.DesHeatVolFlow);
    1153           38 :                 OutputReportPredefined::PreDefTableEntry(
    1154           38 :                     state, state.dataOutRptPredefined->pdchSysSizAdjustedHtAir, curName, finalSysSizing.DesHeatVolFlow, 4);
    1155           19 :                 BaseSizer::reportSizerOutput(
    1156              :                     state, "AirLoopHVAC", curName, "Adjusted Cooling Design Air Flow Rate [m3/s]", finalSysSizing.DesCoolVolFlow);
    1157           38 :                 OutputReportPredefined::PreDefTableEntry(
    1158           38 :                     state, state.dataOutRptPredefined->pdchSysSizAdjustedClAir, curName, finalSysSizing.DesCoolVolFlow, 4);
    1159           19 :                 BaseSizer::reportSizerOutput(
    1160              :                     state, "AirLoopHVAC", curName, "Adjusted Main Design Air Flow Rate [m3/s]", finalSysSizing.DesMainVolFlow);
    1161           38 :                 OutputReportPredefined::PreDefTableEntry(
    1162           38 :                     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           19 :                 if (finalSysSizing.SysAirMinFlowRatWasAutoSized) {
    1166            0 :                     if (finalSysSizing.DesMainVolFlow > 0.0) { // protect div by zero
    1167            0 :                         finalSysSizing.SysAirMinFlowRat = finalSysSizing.DesHeatVolFlow / finalSysSizing.DesMainVolFlow;
    1168              :                     } else { // big trouble anyway.
    1169            0 :                         finalSysSizing.SysAirMinFlowRat = 1.0;
    1170              :                     }
    1171            0 :                     BaseSizer::reportSizerOutput(
    1172              :                         state, "AirLoopHVAC", curName, "Calculated Heating Air Flow Ratio []", finalSysSizing.SysAirMinFlowRat);
    1173            0 :                     OutputReportPredefined::PreDefTableEntry(
    1174            0 :                         state, state.dataOutRptPredefined->pdchSysSizCalcHeatFlowRatio, curName, finalSysSizing.SysAirMinFlowRat, 4);
    1175            0 :                     BaseSizer::reportSizerOutput(state, "AirLoopHVAC", curName, "User Heating Air Flow Ratio []", finalSysSizing.SysAirMinFlowRat);
    1176            0 :                     OutputReportPredefined::PreDefTableEntry(
    1177            0 :                         state, state.dataOutRptPredefined->pdchSysSizUserHeatFlowRatio, curName, finalSysSizing.SysAirMinFlowRat, 4);
    1178              :                 } else {
    1179           19 :                     BaseSizer::reportSizerOutput(state, "AirLoopHVAC", curName, "User Heating Air Flow Ratio []", finalSysSizing.SysAirMinFlowRat);
    1180           38 :                     OutputReportPredefined::PreDefTableEntry(
    1181           38 :                         state, state.dataOutRptPredefined->pdchSysSizUserHeatFlowRatio, curName, finalSysSizing.SysAirMinFlowRat, 4);
    1182           19 :                     Real64 calcSysAirMinFlowRat(0.0);
    1183           19 :                     if (finalSysSizing.DesMainVolFlow > 0.0) { // protect div by zero
    1184           19 :                         calcSysAirMinFlowRat = finalSysSizing.DesHeatVolFlow / finalSysSizing.DesMainVolFlow;
    1185              :                     }
    1186           19 :                     BaseSizer::reportSizerOutput(state, "AirLoopHVAC", curName, "Calculated Heating Air Flow Ratio []", calcSysAirMinFlowRat);
    1187           38 :                     OutputReportPredefined::PreDefTableEntry(
    1188           57 :                         state, state.dataOutRptPredefined->pdchSysSizCalcHeatFlowRatio, curName, calcSysAirMinFlowRat, 4);
    1189              :                 }
    1190              :             }
    1191           19 :         }
    1192              : 
    1193              :     } // if doing any system sizing
    1194           74 : }
    1195              : 
    1196           74 : void ManageSystemVentilationAdjustments(EnergyPlusData &state)
    1197              : {
    1198           74 :     auto &AirDistUnit = state.dataDefineEquipment->AirDistUnit;
    1199           74 :     auto &FinalSysSizing = state.dataSize->FinalSysSizing;
    1200           74 :     auto &VbzByZone = state.dataSize->VbzByZone;
    1201           74 :     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           93 :     for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
    1207              :         int SysSizNum =
    1208           19 :             Util::FindItemInList(FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
    1209           19 :         if (SysSizNum == 0) {
    1210            0 :             SysSizNum = 1; // use first when none applicable
    1211              :         }
    1212           19 :         if (FinalSysSizing(AirLoopNum).OAAutoSized &&
    1213           19 :             (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::VRP ||
    1214           19 :              state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::SP) &&
    1215           43 :             state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones > 1 &&
    1216            5 :             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            0 :             for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++zoneNum) {
    1221            0 :                 int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
    1222            0 :                 auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
    1223            0 :                 if (state.dataSize->VdzMinClgByZone(termUnitSizingIndex) > 0.0) {
    1224            0 :                     state.dataSize->ZdzClgByZone(termUnitSizingIndex) =
    1225            0 :                         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            0 :                 if (state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) > 0.0) {
    1230            0 :                     state.dataSize->ZdzHtgByZone(termUnitSizingIndex) =
    1231            0 :                         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            0 :             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            0 :             state.dataSize->VouBySys(AirLoopNum) =
    1256            0 :                 state.dataSize->DBySys(AirLoopNum) * state.dataSize->SumRpxPzBySys(AirLoopNum) + state.dataSize->SumRaxAzBySys(AirLoopNum);
    1257              :             // redo VpzClgSumBySys( AirLoopNum ) with latest values, for reporting
    1258            0 :             state.dataSize->VpzClgSumBySys(AirLoopNum) = 0.0;
    1259            0 :             for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++zoneNum) {
    1260            0 :                 int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
    1261            0 :                 state.dataSize->VpzClgSumBySys(AirLoopNum) += state.dataSize->VdzClgByZone(termUnitSizingIndex);
    1262              :             }
    1263            0 :             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            0 :             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            0 :             state.dataSize->VpsHtgBySys(AirLoopNum) = 0.0;
    1278            0 :             state.dataSize->VpzHtgSumBySys(AirLoopNum) = 0.0; // for reporting only
    1279            0 :             for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++zoneNum) {
    1280            0 :                 int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
    1281            0 :                 state.dataSize->VpsHtgBySys(AirLoopNum) += state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
    1282            0 :                 state.dataSize->VpzHtgSumBySys(AirLoopNum) += state.dataSize->VpzHtgByZone(termUnitSizingIndex);
    1283              :             }
    1284            0 :             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            0 :             state.dataSize->XsBySysCool(AirLoopNum) = state.dataSize->VouBySys(AirLoopNum) / state.dataSize->VpsClgBySys(AirLoopNum);
    1295            0 :             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            0 :             state.dataSize->EvzMinBySysCool(AirLoopNum) = 1.0;
    1299            0 :             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            0 :             for (int coolHeatPass = 1; coolHeatPass <= 2; ++coolHeatPass) {
    1303            0 :                 int numZones = 0;
    1304            0 :                 if (coolHeatPass == 1) {
    1305            0 :                     numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesCooled;
    1306              :                 } else {
    1307            0 :                     numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesHeated;
    1308              :                 }
    1309            0 :                 for (int zoneNum = 1; zoneNum <= numZones; ++zoneNum) {
    1310            0 :                     int termUnitSizingIndex = 0;
    1311            0 :                     if (coolHeatPass == 1) {
    1312            0 :                         termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
    1313              :                     } else {
    1314            0 :                         termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
    1315              :                     }
    1316            0 :                     auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
    1317            0 :                     Real64 Er = thisTermUnitFinalZoneSizing.ZoneSecondaryRecirculation; // user input in Zone Air Distribution design spec object
    1318              : 
    1319            0 :                     if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::SP) { // 62.1 simplified procedure
    1320            0 :                         if (state.dataSize->DBySys(AirLoopNum) < 0.60) {
    1321            0 :                             state.dataSize->EvzByZoneHeat(termUnitSizingIndex) = 0.88 * state.dataSize->DBySys(AirLoopNum) + 0.22;
    1322              :                         } else {
    1323            0 :                             state.dataSize->EvzByZoneHeat(termUnitSizingIndex) = 0.75;
    1324              :                         }
    1325            0 :                         state.dataSize->EvzByZoneCool(termUnitSizingIndex) = state.dataSize->EvzByZoneHeat(termUnitSizingIndex);
    1326            0 :                     } else if (Er > 0.0) { // 62.1 ventilation rate procedure - multi path zone
    1327              :                         // Find Evz for cooling
    1328            0 :                         Real64 Ep_Clg = thisTermUnitFinalZoneSizing.ZonePrimaryAirFraction; // as adjusted in ManageSystemSizingAdjustments();
    1329            0 :                         Real64 Fa_Clg = Ep_Clg + (1.0 - Ep_Clg) * Er;
    1330            0 :                         state.dataSize->FaByZoneCool(termUnitSizingIndex) = Fa_Clg;
    1331            0 :                         Real64 Fb_Clg = Ep_Clg;
    1332            0 :                         state.dataSize->FbByZoneCool(termUnitSizingIndex) = Fb_Clg;
    1333            0 :                         Real64 Ez_Clg = thisTermUnitFinalZoneSizing.ZoneADEffCooling; // user input in Zone Air Distribution design spec object
    1334            0 :                         Real64 Fc_Clg = 1.0 - (1.0 - Ez_Clg) * (1.0 - Er) * (1 - Ep_Clg);
    1335            0 :                         state.dataSize->FcByZoneCool(termUnitSizingIndex) = Fc_Clg;
    1336            0 :                         state.dataSize->EvzByZoneCool(termUnitSizingIndex) = (Fa_Clg + state.dataSize->XsBySysCool(AirLoopNum) * Fb_Clg -
    1337            0 :                                                                               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            0 :                         Real64 Ep_Htg = thisTermUnitFinalZoneSizing.ZonePrimaryAirFractionHtg; // as adjusted in ManageSystemSizingAdjustments();
    1343            0 :                         Real64 Fa_Htg = Ep_Htg + (1.0 - Ep_Htg) * Er;
    1344            0 :                         state.dataSize->FaByZoneHeat(termUnitSizingIndex) = Fa_Htg;
    1345            0 :                         Real64 Fb_Htg = Ep_Htg;
    1346            0 :                         state.dataSize->FbByZoneHeat(termUnitSizingIndex) = Fb_Htg;
    1347            0 :                         Real64 Ez_Htg = thisTermUnitFinalZoneSizing.ZoneADEffHeating; // user input in Zone Air Distribution design spec object
    1348            0 :                         Real64 Fc_Htg = 1.0 - (1.0 - Ez_Htg) * (1.0 - Er) * (1 - Ep_Htg);
    1349            0 :                         state.dataSize->FcByZoneHeat(termUnitSizingIndex) = Fc_Htg;
    1350            0 :                         state.dataSize->EvzByZoneHeat(termUnitSizingIndex) = (Fa_Htg + state.dataSize->XsBySysHeat(AirLoopNum) * Fb_Htg -
    1351            0 :                                                                               state.dataSize->ZdzHtgByZone(termUnitSizingIndex) * Ep_Htg * Fc_Htg) /
    1352              :                                                                              Fa_Htg;
    1353              : 
    1354              :                     } else { // 62.1 ventilation rate procedure - single path zone
    1355            0 :                         state.dataSize->EvzByZoneCool(termUnitSizingIndex) =
    1356            0 :                             1.0 + state.dataSize->XsBySysCool(AirLoopNum) - state.dataSize->ZdzClgByZone(termUnitSizingIndex);
    1357            0 :                         SimAirServingZones::LimitZoneVentEff(state,
    1358            0 :                                                              state.dataSize->XsBySysCool(AirLoopNum),
    1359            0 :                                                              VbzByZone(termUnitSizingIndex) / state.dataSize->EvzByZoneCool(termUnitSizingIndex),
    1360              :                                                              termUnitSizingIndex,
    1361            0 :                                                              state.dataSize->EvzByZoneCool(termUnitSizingIndex));
    1362            0 :                         state.dataSize->EvzByZoneHeat(termUnitSizingIndex) =
    1363            0 :                             1.0 + state.dataSize->XsBySysHeat(AirLoopNum) - state.dataSize->ZdzHtgByZone(termUnitSizingIndex);
    1364            0 :                         SimAirServingZones::LimitZoneVentEff(state,
    1365            0 :                                                              state.dataSize->XsBySysHeat(AirLoopNum),
    1366            0 :                                                              VbzByZone(termUnitSizingIndex) / state.dataSize->EvzByZoneHeat(termUnitSizingIndex),
    1367              :                                                              termUnitSizingIndex,
    1368            0 :                                                              state.dataSize->EvzByZoneHeat(termUnitSizingIndex));
    1369              :                     }
    1370              : 
    1371            0 :                     if (state.dataSize->EvzByZoneCool(termUnitSizingIndex) < state.dataSize->EvzMinBySysCool(AirLoopNum)) {
    1372            0 :                         state.dataSize->EvzMinBySysCool(AirLoopNum) = state.dataSize->EvzByZoneCool(termUnitSizingIndex);
    1373              :                     }
    1374            0 :                     if (state.dataSize->EvzByZoneHeat(termUnitSizingIndex) < state.dataSize->EvzMinBySysHeat(AirLoopNum)) {
    1375            0 :                         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            0 :                 state.dataSize->VotClgBySys(AirLoopNum) = state.dataSize->VouBySys(AirLoopNum) / state.dataSize->EvzMinBySysCool(AirLoopNum);
    1381            0 :                 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            0 :                 FinalSysSizing(AirLoopNum).DesOutAirVolFlow = max(state.dataSize->VotClgBySys(AirLoopNum), state.dataSize->VotHtgBySys(AirLoopNum));
    1384              :             }
    1385              :         } // system OA is autosized and VRP
    1386           19 :         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           19 :             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           19 :             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           19 :             state.dataSize->VpsHtgBySys(AirLoopNum) = 0.0;
    1421           19 :             state.dataSize->VpzHtgSumBySys(AirLoopNum) = 0.0; // for reporting only
    1422           51 :             for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++zoneNum) {
    1423           32 :                 int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
    1424           32 :                 state.dataSize->VpzClgSumBySys(AirLoopNum) += state.dataSize->VdzClgByZone(termUnitSizingIndex);
    1425           32 :                 state.dataSize->VpsHtgBySys(AirLoopNum) += state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
    1426           32 :                 state.dataSize->VpzHtgSumBySys(AirLoopNum) += state.dataSize->VpzHtgByZone(termUnitSizingIndex);
    1427              :             }
    1428           19 :             for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesHeated; ++zoneNum) {
    1429            0 :                 int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
    1430            0 :                 int MatchingCooledZoneNum = General::FindNumberInList(
    1431            0 :                     termUnitSizingIndex, AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex, AirToZoneNodeInfo(AirLoopNum).NumZonesCooled);
    1432            0 :                 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           93 :     for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
    1443              : 
    1444              :         // System Ventilation Requirements for Cooling (table 1)
    1445           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1446           19 :                                                  state.dataOutRptPredefined->pdchS62svrClSumVpz,
    1447           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1448           19 :                                                  state.dataSize->VpzClgSumBySys(AirLoopNum),
    1449           19 :                                                  4); // Vpz-sum
    1450           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1451           19 :                                                  state.dataOutRptPredefined->pdchS62svrClPs,
    1452           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1453           19 :                                                  state.dataSize->PsBySys(AirLoopNum),
    1454           19 :                                                  4); // Ps
    1455           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1456           19 :                                                  state.dataOutRptPredefined->pdchS62svrClSumPz,
    1457           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1458           19 :                                                  state.dataSize->PzSumBySys(AirLoopNum),
    1459           19 :                                                  4); // Pz-sum
    1460           19 :         OutputReportPredefined::PreDefTableEntry(
    1461           19 :             state, state.dataOutRptPredefined->pdchS62svrClD, FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->DBySys(AirLoopNum), 4); // D
    1462              :         // Origin of D
    1463              :         int SysSizNum =
    1464           19 :             Util::FindItemInList(FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
    1465           19 :         if (SysSizNum == 0) {
    1466            0 :             SysSizNum = 1; // use first when none applicable
    1467              :         }
    1468           19 :         if (state.dataSize->SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
    1469           30 :             OutputReportPredefined::PreDefTableEntry(
    1470           15 :                 state, state.dataOutRptPredefined->pdchS62svrClDorg, FinalSysSizing(AirLoopNum).AirPriLoopName, "Calculated from schedules");
    1471              :         } else {
    1472            8 :             OutputReportPredefined::PreDefTableEntry(
    1473            4 :                 state, state.dataOutRptPredefined->pdchS62svrClDorg, FinalSysSizing(AirLoopNum).AirPriLoopName, "User-specified");
    1474              :         }
    1475           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1476           19 :                                                  state.dataOutRptPredefined->pdchS62svrClVou,
    1477           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1478           19 :                                                  state.dataSize->VouBySys(AirLoopNum),
    1479           19 :                                                  4); // Vou
    1480           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1481           19 :                                                  state.dataOutRptPredefined->pdchS62svrClVps,
    1482           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1483           19 :                                                  state.dataSize->VpsClgBySys(AirLoopNum),
    1484           19 :                                                  4); // Vps
    1485           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1486           19 :                                                  state.dataOutRptPredefined->pdchS62svrClXs,
    1487           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1488           19 :                                                  state.dataSize->XsBySysCool(AirLoopNum),
    1489           19 :                                                  4); // Xs
    1490           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1491           19 :                                                  state.dataOutRptPredefined->pdchS62svrClEv,
    1492           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1493           19 :                                                  state.dataSize->EvzMinBySysCool(AirLoopNum),
    1494           19 :                                                  4); // Ev
    1495              :         // Ev Calculation Methodology
    1496           19 :         if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::VRP) {
    1497            0 :             OutputReportPredefined::PreDefTableEntry(state,
    1498            0 :                                                      state.dataOutRptPredefined->pdchS62svrClEvMthd,
    1499            0 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1500              :                                                      "Standard 62.1 Ventilation Rate Procedure");
    1501           19 :         } else if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::SP) {
    1502           10 :             OutputReportPredefined::PreDefTableEntry(state,
    1503            5 :                                                      state.dataOutRptPredefined->pdchS62svrClEvMthd,
    1504            5 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1505              :                                                      "Standard 62.1 Simplified Procedure");
    1506              :         } else {
    1507           28 :             OutputReportPredefined::PreDefTableEntry(
    1508           14 :                 state, state.dataOutRptPredefined->pdchS62svrClEvMthd, FinalSysSizing(AirLoopNum).AirPriLoopName, "Not calculated");
    1509              :         }
    1510           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1511           19 :                                                  state.dataOutRptPredefined->pdchS62svrClVot,
    1512           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1513           19 :                                                  state.dataSize->VotClgBySys(AirLoopNum),
    1514           19 :                                                  4);          // Vot
    1515           19 :         if (state.dataSize->VpsClgBySys(AirLoopNum) != 0.0) { // Move here
    1516           19 :             OutputReportPredefined::PreDefTableEntry(state,
    1517           19 :                                                      state.dataOutRptPredefined->pdchS62svrClPercOA,
    1518           19 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1519           19 :                                                      state.dataSize->VotClgBySys(AirLoopNum) / state.dataSize->VpsClgBySys(AirLoopNum),
    1520           38 :                                                      4); //%OA
    1521              :         }
    1522           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1523           19 :                                                  state.dataOutRptPredefined->pdchS62svrClEnvironmentOfPs,
    1524           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1525           19 :                                                  state.dataSize->PeakPsOccurrenceEnvironmentStringBySys(AirLoopNum));
    1526           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1527           19 :                                                  state.dataOutRptPredefined->pdchS62svrClTimeOfPs,
    1528           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1529           19 :                                                  state.dataSize->PeakPsOccurrenceDateTimeStringBySys(AirLoopNum));
    1530              : 
    1531              :         // system ventilation requirements for heating ( table 2 )
    1532           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1533           19 :                                                  state.dataOutRptPredefined->pdchS62svrHtSumVpz,
    1534           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1535           19 :                                                  state.dataSize->VpzHtgSumBySys(AirLoopNum),
    1536           19 :                                                  4); // Vpz-sum
    1537           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1538           19 :                                                  state.dataOutRptPredefined->pdchS62svrHtPs,
    1539           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1540           19 :                                                  state.dataSize->PsBySys(AirLoopNum),
    1541           19 :                                                  4); // Ps
    1542           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1543           19 :                                                  state.dataOutRptPredefined->pdchS62svrHtSumPz,
    1544           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1545           19 :                                                  state.dataSize->PzSumBySys(AirLoopNum),
    1546           19 :                                                  4); // Pz-sum
    1547           19 :         OutputReportPredefined::PreDefTableEntry(
    1548           19 :             state, state.dataOutRptPredefined->pdchS62svrHtD, FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->DBySys(AirLoopNum), 4); // D
    1549              :         // Origin of D
    1550           19 :         if (state.dataSize->SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
    1551           30 :             OutputReportPredefined::PreDefTableEntry(
    1552           15 :                 state, state.dataOutRptPredefined->pdchS62svrHtDorg, FinalSysSizing(AirLoopNum).AirPriLoopName, "Calculated from schedules");
    1553              :         } else {
    1554            8 :             OutputReportPredefined::PreDefTableEntry(
    1555            4 :                 state, state.dataOutRptPredefined->pdchS62svrHtDorg, FinalSysSizing(AirLoopNum).AirPriLoopName, "User-specified");
    1556              :         }
    1557           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1558           19 :                                                  state.dataOutRptPredefined->pdchS62svrHtVou,
    1559           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1560           19 :                                                  state.dataSize->VouBySys(AirLoopNum),
    1561           19 :                                                  4); // Vou
    1562           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1563           19 :                                                  state.dataOutRptPredefined->pdchS62svrHtVps,
    1564           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1565           19 :                                                  state.dataSize->VpsHtgBySys(AirLoopNum),
    1566           19 :                                                  4); // Vps
    1567           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1568           19 :                                                  state.dataOutRptPredefined->pdchS62svrHtXs,
    1569           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1570           19 :                                                  state.dataSize->XsBySysHeat(AirLoopNum),
    1571           19 :                                                  4); // Xs
    1572           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1573           19 :                                                  state.dataOutRptPredefined->pdchS62svrHtEv,
    1574           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1575           19 :                                                  state.dataSize->EvzMinBySysHeat(AirLoopNum),
    1576           19 :                                                  4); // Ev
    1577              :         // Ev Calculation Methodology
    1578           19 :         if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::VRP) {
    1579            0 :             OutputReportPredefined::PreDefTableEntry(state,
    1580            0 :                                                      state.dataOutRptPredefined->pdchS62svrHtEvMthd,
    1581            0 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1582              :                                                      "Standard 62.1 Ventilation Rate Procedure");
    1583           19 :         } else if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::SP) {
    1584           10 :             OutputReportPredefined::PreDefTableEntry(state,
    1585            5 :                                                      state.dataOutRptPredefined->pdchS62svrHtEvMthd,
    1586            5 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1587              :                                                      "Standard 62.1 Simplified Procedure");
    1588              :         } else {
    1589           28 :             OutputReportPredefined::PreDefTableEntry(
    1590           14 :                 state, state.dataOutRptPredefined->pdchS62svrHtEvMthd, FinalSysSizing(AirLoopNum).AirPriLoopName, "Not calculated");
    1591              :         }
    1592           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1593           19 :                                                  state.dataOutRptPredefined->pdchS62svrHtVot,
    1594           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1595           19 :                                                  state.dataSize->VotHtgBySys(AirLoopNum),
    1596           19 :                                                  4); // Vot
    1597           19 :         if (state.dataSize->VpsHtgBySys(AirLoopNum) != 0.0) {
    1598           16 :             OutputReportPredefined::PreDefTableEntry(state,
    1599           16 :                                                      state.dataOutRptPredefined->pdchS62svrHtPercOA,
    1600           16 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1601           16 :                                                      state.dataSize->VotHtgBySys(AirLoopNum) / state.dataSize->VpsHtgBySys(AirLoopNum),
    1602           32 :                                                      4); //%OA
    1603              :         }
    1604              :         // heating time of peak Ps is the same as for cooling (for now)
    1605           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1606           19 :                                                  state.dataOutRptPredefined->pdchS62svrHtEnvironmentOfPs,
    1607           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1608           19 :                                                  state.dataSize->PeakPsOccurrenceEnvironmentStringBySys(AirLoopNum));
    1609           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1610           19 :                                                  state.dataOutRptPredefined->pdchS62svrHtTimeOfPs,
    1611           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1612           19 :                                                  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           57 :         for (int coolHeatPass = 1; coolHeatPass <= 2; ++coolHeatPass) {
    1617           38 :             int numZones = 0;
    1618           38 :             if (coolHeatPass == 1) {
    1619           19 :                 numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesCooled;
    1620              :             } else {
    1621           19 :                 numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesHeated;
    1622              :             }
    1623           70 :             for (int zoneNum = 1; zoneNum <= numZones; ++zoneNum) {
    1624           32 :                 int termUnitSizingIndex = 0;
    1625           32 :                 int MatchingCooledZoneNum = 0;
    1626           32 :                 if (coolHeatPass == 1) {
    1627           32 :                     termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
    1628              :                 } else {
    1629            0 :                     termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
    1630            0 :                     MatchingCooledZoneNum = General::FindNumberInList(
    1631            0 :                         termUnitSizingIndex, AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex, AirToZoneNodeInfo(AirLoopNum).NumZonesCooled);
    1632              :                 }
    1633           32 :                 if (MatchingCooledZoneNum == 0) {
    1634           32 :                     auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
    1635           64 :                     OutputReportPredefined::PreDefTableEntry(state,
    1636           32 :                                                              state.dataOutRptPredefined->pdchS62zvpAlN,
    1637              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1638           32 :                                                              state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name); // Air loop name
    1639           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1640           32 :                                                              state.dataOutRptPredefined->pdchS62zvpRp,
    1641              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1642           32 :                                                              thisTermUnitFinalZoneSizing.DesOAFlowPPer,
    1643           32 :                                                              6); // Rp
    1644           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1645           32 :                                                              state.dataOutRptPredefined->pdchS62zvpPz,
    1646              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1647           32 :                                                              thisTermUnitFinalZoneSizing.TotPeopleInZone,
    1648           32 :                                                              4); // Pz
    1649           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1650           32 :                                                              state.dataOutRptPredefined->pdchS62zvpRa,
    1651              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1652           32 :                                                              thisTermUnitFinalZoneSizing.DesOAFlowPerArea,
    1653           32 :                                                              6); // Ra
    1654           64 :                     OutputReportPredefined::PreDefTableEntry(state,
    1655           32 :                                                              state.dataOutRptPredefined->pdchS62zvpAz,
    1656              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1657           32 :                                                              thisTermUnitFinalZoneSizing.TotalZoneFloorArea); // Az
    1658           32 :                     OutputReportPredefined::PreDefTableEntry(
    1659              :                         state,
    1660           32 :                         state.dataOutRptPredefined->pdchS62zvpVbz,
    1661              :                         thisTermUnitFinalZoneSizing.ZoneName,
    1662           32 :                         VbzByZone(termUnitSizingIndex),
    1663           32 :                         4); // Vbz, now corrected so that Vbz does not already have system population term multiplied into it
    1664           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1665           32 :                                                              state.dataOutRptPredefined->pdchS62zvpClEz,
    1666              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1667           32 :                                                              thisTermUnitFinalZoneSizing.ZoneADEffCooling,
    1668           32 :                                                              4); // Ez-clg
    1669           32 :                     if (thisTermUnitFinalZoneSizing.ZoneADEffCooling > 0.0) {
    1670           32 :                         OutputReportPredefined::PreDefTableEntry(state,
    1671           32 :                                                                  state.dataOutRptPredefined->pdchS62zvpClVoz,
    1672              :                                                                  thisTermUnitFinalZoneSizing.ZoneName,
    1673           32 :                                                                  VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffCooling,
    1674           64 :                                                                  4); // Voz-clg
    1675              :                     }
    1676           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1677           32 :                                                              state.dataOutRptPredefined->pdchS62zvpHtEz,
    1678              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1679           32 :                                                              thisTermUnitFinalZoneSizing.ZoneADEffHeating,
    1680           32 :                                                              3); // Ez-htg
    1681           32 :                     if (thisTermUnitFinalZoneSizing.ZoneADEffHeating != 0.0) {
    1682           32 :                         OutputReportPredefined::PreDefTableEntry(state,
    1683           32 :                                                                  state.dataOutRptPredefined->pdchS62zvpHtVoz,
    1684              :                                                                  thisTermUnitFinalZoneSizing.ZoneName,
    1685           32 :                                                                  VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffHeating,
    1686           64 :                                                                  4); // Voz-htg
    1687              :                     }
    1688              :                 }
    1689              :             }
    1690              :         }
    1691              : 
    1692              :         // System Ventilation Parameters, (Table 4)
    1693              : 
    1694              :         // first do some summations needed
    1695           19 :         Real64 RpPzSum(0.0);
    1696           19 :         Real64 RaAzSum(0.0);
    1697           19 :         Real64 AzSum(0.0);
    1698           19 :         Real64 VbzSum(0.0);
    1699           19 :         Real64 VozClgSum(0.0);
    1700           19 :         Real64 VozHtgSum(0.0);
    1701           19 :         Real64 VdzClgSum(0.0);
    1702           19 :         Real64 VdzHtgSum(0.0);
    1703           19 :         Real64 VpzMinClgSum(0.0);
    1704           19 :         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           57 :         for (int coolHeatPass = 1; coolHeatPass <= 2; ++coolHeatPass) {
    1707           38 :             int numZones = 0;
    1708           38 :             if (coolHeatPass == 1) {
    1709           19 :                 numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesCooled;
    1710              :             } else {
    1711           19 :                 numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesHeated;
    1712              :             }
    1713           70 :             for (int airLoopZoneNum = 1; airLoopZoneNum <= numZones; ++airLoopZoneNum) {
    1714           32 :                 int termUnitSizingIndex = 0;
    1715           32 :                 int MatchingCooledZoneNum = 0;
    1716           32 :                 if (coolHeatPass == 1) {
    1717           32 :                     termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(airLoopZoneNum);
    1718              :                 } else {
    1719            0 :                     termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(airLoopZoneNum);
    1720            0 :                     MatchingCooledZoneNum = General::FindNumberInList(
    1721            0 :                         termUnitSizingIndex, AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex, AirToZoneNodeInfo(AirLoopNum).NumZonesCooled);
    1722              :                 }
    1723           32 :                 if (MatchingCooledZoneNum == 0) {
    1724           32 :                     auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
    1725              :                     // Zone ventilation parameters, (table 3)
    1726           32 :                     RpPzSum += thisTermUnitFinalZoneSizing.DesOAFlowPPer * thisTermUnitFinalZoneSizing.TotPeopleInZone;
    1727           32 :                     RaAzSum += thisTermUnitFinalZoneSizing.DesOAFlowPerArea * thisTermUnitFinalZoneSizing.TotalZoneFloorArea;
    1728           32 :                     AzSum += thisTermUnitFinalZoneSizing.TotalZoneFloorArea;
    1729           32 :                     VbzSum += VbzByZone(termUnitSizingIndex);
    1730           32 :                     if (thisTermUnitFinalZoneSizing.ZoneADEffCooling != 0.0) {
    1731           32 :                         VozClgSum += VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffCooling;
    1732              :                     }
    1733           32 :                     if (thisTermUnitFinalZoneSizing.ZoneADEffHeating != 0.0) {
    1734           32 :                         VozHtgSum += VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffHeating;
    1735              :                     }
    1736              : 
    1737           32 :                     VpzMinClgSum += state.dataSize->VpzMinClgByZone(termUnitSizingIndex);
    1738           32 :                     VdzClgSum += state.dataSize->VdzClgByZone(termUnitSizingIndex);
    1739           32 :                     VpzMinHtgSum += state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
    1740           32 :                     VdzHtgSum += state.dataSize->VdzMinHtgByZone(termUnitSizingIndex);
    1741              : 
    1742              :                     // Zone Ventilation Calculations for Cooling Design, (Table 5)
    1743           64 :                     OutputReportPredefined::PreDefTableEntry(state,
    1744           32 :                                                              state.dataOutRptPredefined->pdchS62zcdAlN,
    1745              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1746           32 :                                                              AirToZoneNodeInfo(AirLoopNum).AirLoopName); // Air loop name
    1747           51 :                     for (int iAirDistUnit = 1; iAirDistUnit <= (int)state.dataDefineEquipment->AirDistUnit.size(); ++iAirDistUnit) {
    1748           51 :                         if (AirDistUnit(iAirDistUnit).TermUnitSizingNum == termUnitSizingIndex) {
    1749           64 :                             OutputReportPredefined::PreDefTableEntry(state,
    1750           32 :                                                                      state.dataOutRptPredefined->pdchS62zcdBox,
    1751              :                                                                      thisTermUnitFinalZoneSizing.ZoneName,
    1752           32 :                                                                      AirDistUnit(iAirDistUnit).EquipType(1)); // use first type of equipment listed
    1753           32 :                             break; // if it has been found no more searching is needed
    1754              :                         }
    1755              :                     }
    1756           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1757           32 :                                                              state.dataOutRptPredefined->pdchS62zcdVpz,
    1758              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1759           32 :                                                              state.dataSize->VpzClgByZone(termUnitSizingIndex),
    1760           32 :                                                              4); // Vpz LS:
    1761           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1762           32 :                                                              state.dataOutRptPredefined->pdchS62zcdVdz,
    1763              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1764           32 :                                                              state.dataSize->VdzClgByZone(termUnitSizingIndex),
    1765           32 :                                                              4); // Vdz
    1766           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1767           32 :                                                              state.dataOutRptPredefined->pdchS62zcdVpzmin,
    1768              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1769           32 :                                                              state.dataSize->VpzMinClgByZone(termUnitSizingIndex),
    1770           32 :                                                              4); // Vpz-min
    1771              :                     // Vpz-min, simplified procedure?
    1772           32 :                     if (thisTermUnitFinalZoneSizing.VpzMinByZoneSPSized) {
    1773           20 :                         OutputReportPredefined::PreDefTableEntry(
    1774           10 :                             state, state.dataOutRptPredefined->pdchS62zcdVpzminSPSize, thisTermUnitFinalZoneSizing.ZoneName, "Yes");
    1775              :                     } else {
    1776           44 :                         OutputReportPredefined::PreDefTableEntry(
    1777           22 :                             state, state.dataOutRptPredefined->pdchS62zcdVpzminSPSize, thisTermUnitFinalZoneSizing.ZoneName, "No");
    1778              :                     }
    1779           32 :                     Real64 VozClg = 0.0;
    1780           32 :                     if (thisTermUnitFinalZoneSizing.ZoneADEffCooling > 0.0) {
    1781           32 :                         VozClg = VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffCooling;
    1782           64 :                         OutputReportPredefined::PreDefTableEntry(state,
    1783           32 :                                                                  state.dataOutRptPredefined->pdchS62zcdVozclg,
    1784              :                                                                  thisTermUnitFinalZoneSizing.ZoneName,
    1785              :                                                                  VozClg,
    1786           64 :                                                                  4); // Voz-clg
    1787              :                     }
    1788           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1789           32 :                                                              state.dataOutRptPredefined->pdchS62zcdZpz,
    1790              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1791           32 :                                                              state.dataSize->ZdzClgByZone(termUnitSizingIndex),
    1792           32 :                                                              4); // Zpz = Voz/Vpz (see eq 6-5 in 62.1-2010)
    1793           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1794           32 :                                                              state.dataOutRptPredefined->pdchS62zcdEp,
    1795              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1796           32 :                                                              thisTermUnitFinalZoneSizing.ZonePrimaryAirFraction,
    1797           32 :                                                              4); // Ep
    1798           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1799           32 :                                                              state.dataOutRptPredefined->pdchS62zcdEr,
    1800              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1801           32 :                                                              thisTermUnitFinalZoneSizing.ZoneSecondaryRecirculation,
    1802           32 :                                                              4); // Er
    1803           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1804           32 :                                                              state.dataOutRptPredefined->pdchS62zcdFa,
    1805              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1806           32 :                                                              state.dataSize->FaByZoneCool(termUnitSizingIndex),
    1807           32 :                                                              4); // Fa
    1808           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1809           32 :                                                              state.dataOutRptPredefined->pdchS62zcdFb,
    1810              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1811           32 :                                                              state.dataSize->FbByZoneCool(termUnitSizingIndex),
    1812           32 :                                                              4); // Fb
    1813           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1814           32 :                                                              state.dataOutRptPredefined->pdchS62zcdFc,
    1815              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1816           32 :                                                              state.dataSize->FcByZoneCool(termUnitSizingIndex),
    1817           32 :                                                              4); // Fc
    1818           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1819           32 :                                                              state.dataOutRptPredefined->pdchS62zcdEvz,
    1820              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1821           32 :                                                              state.dataSize->EvzByZoneCool(termUnitSizingIndex),
    1822           32 :                                                              4); // Evz
    1823              : 
    1824              :                     // Zone Ventilation Calculations for Heating Design (Table 7)
    1825           64 :                     OutputReportPredefined::PreDefTableEntry(state,
    1826           32 :                                                              state.dataOutRptPredefined->pdchS62zhdAlN,
    1827              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1828           32 :                                                              AirToZoneNodeInfo(AirLoopNum).AirLoopName); // Air loop name
    1829           51 :                     for (int iAirDistUnit = 1; iAirDistUnit <= (int)state.dataDefineEquipment->AirDistUnit.size(); ++iAirDistUnit) {
    1830           51 :                         if (AirDistUnit(iAirDistUnit).TermUnitSizingNum == termUnitSizingIndex) {
    1831           64 :                             OutputReportPredefined::PreDefTableEntry(state,
    1832           32 :                                                                      state.dataOutRptPredefined->pdchS62zhdBox,
    1833              :                                                                      thisTermUnitFinalZoneSizing.ZoneName,
    1834           32 :                                                                      AirDistUnit(iAirDistUnit).EquipType(1)); // use first type of equipment listed
    1835           32 :                             break; // if it has been found no more searching is needed
    1836              :                         }
    1837              :                     }
    1838           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1839           32 :                                                              state.dataOutRptPredefined->pdchS62zhdVpz,
    1840              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1841           32 :                                                              state.dataSize->VpzHtgByZone(termUnitSizingIndex),
    1842           32 :                                                              4); // Vpz
    1843           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1844           32 :                                                              state.dataOutRptPredefined->pdchS62zhdVdz,
    1845              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1846           32 :                                                              state.dataSize->VdzHtgByZone(termUnitSizingIndex),
    1847           32 :                                                              4); // Vdz
    1848           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1849           32 :                                                              state.dataOutRptPredefined->pdchS62zhdVpzmin,
    1850              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1851           32 :                                                              state.dataSize->VpzMinHtgByZone(termUnitSizingIndex),
    1852           32 :                                                              4); // Vpz-min
    1853              :                     // Vpz-min, simplified procedure?
    1854           32 :                     if (thisTermUnitFinalZoneSizing.VpzMinByZoneSPSized) {
    1855           20 :                         OutputReportPredefined::PreDefTableEntry(
    1856           10 :                             state, state.dataOutRptPredefined->pdchS62zhdVpzminSPSize, thisTermUnitFinalZoneSizing.ZoneName, "Yes");
    1857              :                     } else {
    1858           44 :                         OutputReportPredefined::PreDefTableEntry(
    1859           22 :                             state, state.dataOutRptPredefined->pdchS62zhdVpzminSPSize, thisTermUnitFinalZoneSizing.ZoneName, "No");
    1860              :                     }
    1861           32 :                     Real64 VozHtg = 0.0;
    1862           32 :                     if (thisTermUnitFinalZoneSizing.ZoneADEffHeating != 0.0) {
    1863           32 :                         VozHtg = VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffHeating;
    1864           64 :                         OutputReportPredefined::PreDefTableEntry(state,
    1865           32 :                                                                  state.dataOutRptPredefined->pdchS62zhdVozhtg,
    1866              :                                                                  thisTermUnitFinalZoneSizing.ZoneName,
    1867              :                                                                  VozHtg,
    1868           64 :                                                                  4); // Voz-htg
    1869              :                     }
    1870              :                     // Outdoor Air Details Report - Design Zone Outdoor Airflow - Voz
    1871           32 :                     int const zoneMult = state.dataHeatBal->Zone(thisTermUnitFinalZoneSizing.ZoneNum).Multiplier *
    1872           32 :                                          state.dataHeatBal->Zone(thisTermUnitFinalZoneSizing.ZoneNum).ListMultiplier;
    1873           32 :                     Real64 VozMax = std::max(VozHtg, VozClg); // take larger of the heating and cooling Voz values
    1874           64 :                     OutputReportPredefined::PreDefTableEntry(
    1875           64 :                         state, state.dataOutRptPredefined->pdchOaMvDesZnOa, thisTermUnitFinalZoneSizing.ZoneName, VozMax / zoneMult, 4);
    1876           32 :                     state.dataOutRptPredefined->TotalVozMax += VozMax;
    1877           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1878           32 :                                                              state.dataOutRptPredefined->pdchS62zhdZpz,
    1879              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1880           32 :                                                              thisTermUnitFinalZoneSizing.ZpzHtgByZone,
    1881           32 :                                                              4); // Zpz = Voz/Vpz (see eq 6-5 in 62.1-2010)
    1882           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1883           32 :                                                              state.dataOutRptPredefined->pdchS62zhdEp,
    1884              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1885           32 :                                                              thisTermUnitFinalZoneSizing.ZonePrimaryAirFractionHtg,
    1886           32 :                                                              4); // Ep
    1887           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1888           32 :                                                              state.dataOutRptPredefined->pdchS62zhdEr,
    1889              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1890           32 :                                                              thisTermUnitFinalZoneSizing.ZoneSecondaryRecirculation,
    1891           32 :                                                              4); // Er
    1892           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1893           32 :                                                              state.dataOutRptPredefined->pdchS62zhdFa,
    1894              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1895           32 :                                                              state.dataSize->FaByZoneHeat(termUnitSizingIndex),
    1896           32 :                                                              4); // Fa
    1897           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1898           32 :                                                              state.dataOutRptPredefined->pdchS62zhdFb,
    1899              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1900           32 :                                                              state.dataSize->FbByZoneHeat(termUnitSizingIndex),
    1901           32 :                                                              4); // Fb
    1902           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1903           32 :                                                              state.dataOutRptPredefined->pdchS62zhdFc,
    1904              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1905           32 :                                                              state.dataSize->FcByZoneHeat(termUnitSizingIndex),
    1906           32 :                                                              4); // Fc
    1907           32 :                     OutputReportPredefined::PreDefTableEntry(state,
    1908           32 :                                                              state.dataOutRptPredefined->pdchS62zhdEvz,
    1909              :                                                              thisTermUnitFinalZoneSizing.ZoneName,
    1910           32 :                                                              state.dataSize->EvzByZoneHeat(termUnitSizingIndex),
    1911           64 :                                                              4); // Evz
    1912              :                 }
    1913              :             }
    1914              :         }
    1915              : 
    1916              :         // System Ventilation Parameters, (Table 4)
    1917           19 :         if (state.dataSize->PzSumBySys(AirLoopNum) != 0.0) {
    1918            8 :             OutputReportPredefined::PreDefTableEntry(state,
    1919            8 :                                                      state.dataOutRptPredefined->pdchS62svpRp,
    1920            8 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1921            8 :                                                      RpPzSum / state.dataSize->PzSumBySys(AirLoopNum),
    1922           16 :                                                      6); // Average Rp for system
    1923              :         }
    1924           38 :         OutputReportPredefined::PreDefTableEntry(
    1925           19 :             state, state.dataOutRptPredefined->pdchS62svpPz, FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->PzSumBySys(AirLoopNum));
    1926           19 :         if (AzSum != 0.0) {
    1927           19 :             OutputReportPredefined::PreDefTableEntry(state,
    1928           19 :                                                      state.dataOutRptPredefined->pdchS62svpRa,
    1929           19 :                                                      FinalSysSizing(AirLoopNum).AirPriLoopName,
    1930              :                                                      RaAzSum / AzSum,
    1931           38 :                                                      6); // average Ra for system
    1932              :         }
    1933           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1934           19 :                                                  state.dataOutRptPredefined->pdchS62svpAz,
    1935           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1936              :                                                  AzSum,
    1937           19 :                                                  4); // Az sum
    1938           19 :         OutputReportPredefined::PreDefTableEntry(
    1939           19 :             state, state.dataOutRptPredefined->pdchS62svpVbz, FinalSysSizing(AirLoopNum).AirPriLoopName, VbzSum, 4);
    1940           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1941           19 :                                                  state.dataOutRptPredefined->pdchS62svpClVoz,
    1942           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1943              :                                                  VozClgSum,
    1944           19 :                                                  4); // Voz-clg
    1945           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1946           19 :                                                  state.dataOutRptPredefined->pdchS62svpHtVoz,
    1947           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1948              :                                                  VozHtgSum,
    1949           19 :                                                  4); // Voz-htg
    1950              : 
    1951              :         // System Ventilation Calculations for Cooling Design (Table 6)
    1952           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1953           19 :                                                  state.dataOutRptPredefined->pdchS62scdVpz,
    1954           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1955           19 :                                                  state.dataSize->VpzClgSumBySys(AirLoopNum),
    1956           19 :                                                  4); // Vpz-sum
    1957           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1958           19 :                                                  state.dataOutRptPredefined->pdchS62scdVps,
    1959           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1960           19 :                                                  state.dataSize->VpsClgBySys(AirLoopNum),
    1961           19 :                                                  4); // Vps
    1962           19 :         OutputReportPredefined::PreDefTableEntry(
    1963           19 :             state, state.dataOutRptPredefined->pdchS62scdVpzmin, FinalSysSizing(AirLoopNum).AirPriLoopName, VpzMinClgSum, 4); // Vpz-min
    1964           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1965           19 :                                                  state.dataOutRptPredefined->pdchS62scdVdz,
    1966           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1967              :                                                  VdzClgSum,
    1968           19 :                                                  4); // Vdz-sum
    1969           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1970           19 :                                                  state.dataOutRptPredefined->pdchS62scdVozclg,
    1971           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1972              :                                                  VozClgSum,
    1973           19 :                                                  4); // Voz-clg
    1974           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1975           19 :                                                  state.dataOutRptPredefined->pdchS62scdEvz,
    1976           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1977           19 :                                                  state.dataSize->EvzMinBySysCool(AirLoopNum),
    1978           19 :                                                  4); // Evz-min
    1979              : 
    1980              :         // System Ventilation Calculations for Heating Design (Table 8)
    1981           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1982           19 :                                                  state.dataOutRptPredefined->pdchS62shdVpz,
    1983           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1984           19 :                                                  state.dataSize->VpzHtgSumBySys(AirLoopNum),
    1985           19 :                                                  4); // Vpz-sum
    1986           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1987           19 :                                                  state.dataOutRptPredefined->pdchS62shdVps,
    1988           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1989           19 :                                                  state.dataSize->VpsHtgBySys(AirLoopNum),
    1990           19 :                                                  4); // Vps
    1991           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1992           19 :                                                  state.dataOutRptPredefined->pdchS62shdVdz,
    1993           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    1994              :                                                  VdzHtgSum,
    1995           19 :                                                  4); // Vdz-sum
    1996           19 :         OutputReportPredefined::PreDefTableEntry(
    1997           19 :             state, state.dataOutRptPredefined->pdchS62shdVpzmin, FinalSysSizing(AirLoopNum).AirPriLoopName, VpzMinHtgSum, 4); // Vpz-min
    1998           19 :         OutputReportPredefined::PreDefTableEntry(state,
    1999           19 :                                                  state.dataOutRptPredefined->pdchS62shdVozhtg,
    2000           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    2001              :                                                  VozHtgSum,
    2002           19 :                                                  4); // Voz-htg
    2003           19 :         OutputReportPredefined::PreDefTableEntry(state,
    2004           19 :                                                  state.dataOutRptPredefined->pdchS62shdEvz,
    2005           19 :                                                  FinalSysSizing(AirLoopNum).AirPriLoopName,
    2006           19 :                                                  state.dataSize->EvzMinBySysHeat(AirLoopNum),
    2007           38 :                                                  4); // Evz-min
    2008              : 
    2009              :     } // loop over air loops for table writing
    2010           74 : }
    2011              : 
    2012           28 : 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           28 :     bool anyVRPinModel(false);
    2019           51 :     for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
    2020           28 :         auto const &finalSysSizing = state.dataSize->FinalSysSizing(AirLoopNum);
    2021           28 :         if (finalSysSizing.SystemOAMethod == SysOAMethod::VRP || finalSysSizing.SystemOAMethod == SysOAMethod::SP) {
    2022            5 :             anyVRPinModel = true;
    2023            5 :             break;
    2024              :         }
    2025              :     }
    2026              :     // First get the design (max) level of people in all zones connected to air loop
    2027           56 :     for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
    2028           28 :         auto const &finalSysSizing = state.dataSize->FinalSysSizing(AirLoopNum);
    2029           28 :         int SysSizNum = Util::FindItemInList(finalSysSizing.AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
    2030           28 :         if (SysSizNum == 0) {
    2031            0 :             SysSizNum = 1; // use first when none applicable
    2032              :         }
    2033              :         // only retrieve data if the occupant density is set to be autosized
    2034           28 :         if (finalSysSizing.OAAutoSized && state.dataSize->SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
    2035           24 :             auto &pzSumBySys = state.dataSize->PzSumBySys(AirLoopNum);
    2036           24 :             pzSumBySys = 0.0;
    2037           24 :             state.dataSize->PsBySys(AirLoopNum) = 0.0;
    2038           62 :             for (int zoneNumOnLoop = 1; zoneNumOnLoop <= state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones; ++zoneNumOnLoop) {
    2039           38 :                 int zoneNum = state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).ActualZoneNumber(zoneNumOnLoop);
    2040           38 :                 auto const &finalZoneSizing = state.dataSize->FinalZoneSizing(zoneNum);
    2041          108 :                 for (int PeopleNum = 1; PeopleNum <= state.dataHeatBal->TotPeople; ++PeopleNum) {
    2042           70 :                     if (state.dataHeatBal->People(PeopleNum).ZonePtr == finalZoneSizing.ZoneNum) {
    2043           28 :                         pzSumBySys +=
    2044           28 :                             (state.dataHeatBal->People(PeopleNum).NumberOfPeople * state.dataHeatBal->Zone(finalZoneSizing.ZoneNum).Multiplier *
    2045           28 :                              state.dataHeatBal->Zone(finalZoneSizing.ZoneNum).ListMultiplier);
    2046              :                     }
    2047              :                 }
    2048              :             }
    2049              :         }
    2050              :     }
    2051              : 
    2052           28 :     if (!anyVRPinModel) {
    2053           46 :         for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
    2054           23 :             state.dataSize->DBySys(AirLoopNum) = 1.0;
    2055              :         }
    2056           23 :         return; // early return to not march through schedules
    2057              :     }
    2058              : 
    2059            5 :     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            5 :     int DaysInYear(366);  // assume leap year
    2062            5 :     int dayOfWeekType(1); // assume year starts on Sunday
    2063            5 :     Weather::CalcSpecialDayTypes(state);
    2064         1835 :     for (int DayLoop = 1; DayLoop <= DaysInYear; ++DayLoop) { // loop over all days in year
    2065         1830 :         state.dataEnvrn->HolidayIndex = state.dataWeather->SpecialDayTypes(DayLoop);
    2066         1830 :         state.dataEnvrn->DayOfYear_Schedule = DayLoop;
    2067         1830 :         state.dataEnvrn->DayOfWeek = dayOfWeekType;
    2068         1830 :         ++dayOfWeekType;
    2069         1830 :         if (dayOfWeekType > 7) {
    2070          260 :             dayOfWeekType = 1;
    2071              :         }
    2072        45750 :         for (int hrOfDay = 1; hrOfDay <= Constant::iHoursInDay; ++hrOfDay) {  // loop over all hours in day
    2073        43920 :             state.dataGlobal->HourOfDay = hrOfDay;                            // avoid crash in schedule manager
    2074       219600 :             for (int TS = 1; TS <= state.dataGlobal->TimeStepsInHour; ++TS) { // loop over all timesteps in hour
    2075       175680 :                 state.dataGlobal->TimeStep = TS;                              // avoid crash in schedule manager
    2076       175680 :                 Real64 TSfraction(0.0);
    2077       175680 :                 if (state.dataGlobal->TimeStepsInHour > 0.0) {
    2078       175680 :                     TSfraction = 1.0 / double(state.dataGlobal->TimeStepsInHour);
    2079              :                 }
    2080       351360 :                 for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) { // loop over all the air systems
    2081       175680 :                     auto const &finalSysSizing = state.dataSize->FinalSysSizing(AirLoopNum);
    2082              :                     int SysSizNum =
    2083       175680 :                         Util::FindItemInList(finalSysSizing.AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
    2084       175680 :                     if (SysSizNum == 0) {
    2085            0 :                         SysSizNum = 1; // use first when none applicable
    2086              :                     }
    2087       175680 :                     if (finalSysSizing.OAAutoSized && state.dataSize->SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
    2088              : 
    2089              :                         // Loop over all zones connected to air loop
    2090        35136 :                         Real64 TotConcurrentPeopleOnSys = 0.0;
    2091       105408 :                         for (int zoneNumOnLoop = 1; zoneNumOnLoop <= state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones; ++zoneNumOnLoop) {
    2092        70272 :                             int CtrlZoneNum = state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).ActualZoneNumber(zoneNumOnLoop);
    2093              : 
    2094       210816 :                             for (int PeopleNum = 1; PeopleNum <= state.dataHeatBal->TotPeople; ++PeopleNum) {
    2095       140544 :                                 if (state.dataHeatBal->People(PeopleNum).ZonePtr == state.dataSize->FinalZoneSizing(CtrlZoneNum).ZoneNum) {
    2096              :                                     Real64 PeopleInZone =
    2097        70272 :                                         (state.dataHeatBal->People(PeopleNum).NumberOfPeople *
    2098        70272 :                                          state.dataHeatBal->Zone(state.dataSize->FinalZoneSizing(CtrlZoneNum).ZoneNum).Multiplier *
    2099        70272 :                                          state.dataHeatBal->Zone(state.dataSize->FinalZoneSizing(CtrlZoneNum).ZoneNum).ListMultiplier);
    2100        70272 :                                     Real64 schMultiplier = state.dataHeatBal->People(PeopleNum).sched->getHrTsVal(state, hrOfDay, TS);
    2101        70272 :                                     PeopleInZone = PeopleInZone * schMultiplier;
    2102        70272 :                                     TotConcurrentPeopleOnSys += PeopleInZone;
    2103              :                                 }
    2104              :                             }
    2105              :                         }
    2106        35136 :                         if (TotConcurrentPeopleOnSys >= state.dataSize->PsBySys(AirLoopNum)) {
    2107        35136 :                             state.dataSize->PsBySys(AirLoopNum) = TotConcurrentPeopleOnSys; // store max concurrent occupancy on system
    2108              :                             // store timing description of Last occurrence of max
    2109        35136 :                             int Month(0);
    2110        35136 :                             int DayOfMonth(0);
    2111        35136 :                             General::InvOrdinalDay(DayLoop, Month, DayOfMonth, 1);
    2112        35136 :                             Real64 TimeHrsFraction = (double(hrOfDay) - 1.0) + double(TS) * TSfraction;
    2113        35136 :                             int TimeHrsInt = int(TimeHrsFraction);
    2114        35136 :                             int TimeMinsInt = nint((TimeHrsFraction - TimeHrsInt) * 60.0);
    2115        35136 :                             if (TimeMinsInt == 60) {
    2116            0 :                                 ++TimeHrsInt;
    2117            0 :                                 TimeMinsInt = 0;
    2118              :                             }
    2119        35136 :                             state.dataSize->PeakPsOccurrenceDateTimeStringBySys(AirLoopNum) =
    2120        70272 :                                 format("{:02}/{:02} {:02}:{:02}", Month, DayOfMonth, TimeHrsInt, TimeMinsInt);
    2121        35136 :                             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           10 :     for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
    2131            5 :         auto const &finalSysSizing = state.dataSize->FinalSysSizing(AirLoopNum);
    2132            5 :         int SysSizNum = Util::FindItemInList(finalSysSizing.AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
    2133            5 :         if (SysSizNum == 0) {
    2134            0 :             SysSizNum = 1; // use first when none applicable
    2135              :         }
    2136              : 
    2137              :         // compute D if set to autosize
    2138            5 :         if (state.dataSize->SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
    2139            1 :             if (state.dataSize->PzSumBySys(AirLoopNum) > 0.0) {
    2140            1 :                 state.dataSize->DBySys(AirLoopNum) = state.dataSize->PsBySys(AirLoopNum) / state.dataSize->PzSumBySys(AirLoopNum);
    2141              :             } else {
    2142            0 :                 state.dataSize->DBySys(AirLoopNum) = 1.0;
    2143              :             }
    2144            1 :             state.dataSize->DBySys(AirLoopNum) = min(1.0, state.dataSize->DBySys(AirLoopNum));
    2145              :         } else {
    2146              :             // set the occupant diversity based on user-specified value
    2147            4 :             state.dataSize->DBySys(AirLoopNum) = state.dataSize->SysSizInput(SysSizNum).OccupantDiversity;
    2148              :         }
    2149              : 
    2150              :         // For single zone systems, D should be 1.0.
    2151            5 :         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          120 : 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          120 :     std::string CurrentModuleObject; // for ease in getting objects
    2185          120 :     Array1D_string Alphas;           // Alpha input items for object
    2186          120 :     Array1D_string cAlphaFields;     // Alpha field names
    2187          120 :     Array1D_string cNumericFields;   // Numeric field names
    2188          120 :     Array1D<Real64> Numbers;         // Numeric input items for object
    2189          120 :     Array1D_bool lAlphaBlanks;       // Logical array, alpha field input BLANK = .TRUE.
    2190          120 :     Array1D_bool lNumericBlanks;     // Logical array, numeric field input BLANK = .TRUE.
    2191              : 
    2192          120 :     CurrentModuleObject = "DesignSpecification:OutdoorAir";
    2193          120 :     int numOARequirements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
    2194          120 :     state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, TotalArgs, NumAlphas, NumNumbers);
    2195          120 :     std::string cCurrentModuleObject2 = "DesignSpecification:OutdoorAir:SpaceList";
    2196          120 :     int numOARequirementsLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject2);
    2197          120 :     state.dataSize->NumOARequirements = numOARequirements + numOARequirementsLists;
    2198              : 
    2199          120 :     Alphas.allocate(NumAlphas);
    2200          120 :     cAlphaFields.allocate(NumAlphas);
    2201          120 :     cNumericFields.allocate(NumNumbers);
    2202          120 :     Numbers.dimension(NumNumbers, 0.0);
    2203          120 :     lAlphaBlanks.dimension(NumAlphas, true);
    2204          120 :     lNumericBlanks.dimension(NumNumbers, true);
    2205              : 
    2206          120 :     if (state.dataSize->NumOARequirements > 0) {
    2207              :         int IOStatus;            // Used in GetObjectItem
    2208           75 :         bool ErrorsFound(false); // If errors detected in input
    2209           75 :         state.dataSize->OARequirements.allocate(state.dataSize->NumOARequirements);
    2210              : 
    2211              :         // Start Loading the System Input
    2212          182 :         for (int OAIndex = 1; OAIndex <= numOARequirements; ++OAIndex) {
    2213              : 
    2214          107 :             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          107 :             Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound);
    2227              : 
    2228          107 :             state.dataSize->OARequirements(OAIndex).Name = Alphas(1);
    2229              : 
    2230          107 :             ProcessInputOARequirements(
    2231              :                 state, CurrentModuleObject, OAIndex, Alphas, NumAlphas, Numbers, NumNumbers, lAlphaBlanks, cAlphaFields, ErrorsFound);
    2232              :         }
    2233              : 
    2234           75 :         Alphas.deallocate();
    2235           75 :         cAlphaFields.deallocate();
    2236           75 :         cNumericFields.deallocate();
    2237           75 :         Numbers.deallocate();
    2238           75 :         lAlphaBlanks.deallocate();
    2239           75 :         lNumericBlanks.deallocate();
    2240              : 
    2241              :         // DesignSpecification:OutdoorAir:SpaceList
    2242           75 :         auto &ip = state.dataInputProcessing->inputProcessor;
    2243           75 :         auto const instances = ip->epJSON.find(cCurrentModuleObject2);
    2244           75 :         if (instances != ip->epJSON.end()) {
    2245            1 :             auto const &objectSchemaProps = ip->getObjectSchemaProps(state, cCurrentModuleObject2);
    2246            1 :             auto &instancesValue = instances.value();
    2247            1 :             int oaIndex = numOARequirements; // add lists to the end of the same array
    2248              : 
    2249            2 :             for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
    2250            1 :                 ++oaIndex;
    2251            1 :                 auto const &objectFields = instance.value();
    2252            1 :                 auto &thisOAReq = state.dataSize->OARequirements(oaIndex);
    2253            1 :                 ip->markObjectAsUsed(cCurrentModuleObject2, instance.key());
    2254            1 :                 std::string thisOAReqName = Util::makeUPPER(instance.key());
    2255              : 
    2256            1 :                 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            1 :                 thisOAReq.Name = thisOAReqName;
    2263              : 
    2264              :                 // List of spaces and DSOA names
    2265            1 :                 thisOAReq.numDSOA = 0;
    2266            1 :                 auto extensibles = objectFields.find("space_specs");
    2267            1 :                 auto const &extensionSchemaProps = objectSchemaProps["space_specs"]["items"]["properties"];
    2268            1 :                 if (extensibles != objectFields.end()) {
    2269            1 :                     auto &extensiblesArray = extensibles.value();
    2270            5 :                     for (auto &extensibleInstance : extensiblesArray) {
    2271              :                         // Zones and spaces are not created yet, validate space names in ZoneEquipmentManager::SetupZoneSizingArrays
    2272            8 :                         std::string thisSpaceName = ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "space_name");
    2273            4 :                         thisOAReq.dsoaSpaceNames.emplace_back(thisSpaceName);
    2274              :                         std::string thisDsoaName =
    2275            8 :                             ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "space_design_specification_outdoor_air_object_name");
    2276            4 :                         int thisDsoaNum = Util::FindItemInList(thisDsoaName, state.dataSize->OARequirements, oaIndex);
    2277            4 :                         if (thisDsoaNum > 0) {
    2278            4 :                             thisOAReq.dsoaIndexes.emplace_back(thisDsoaNum);
    2279            4 :                             ++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            5 :                     }
    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            2 :             }
    2292              : 
    2293            1 :             if (ErrorsFound) {
    2294            0 :                 ShowFatalError(state, format("{}Errors found in input.  Preceding condition(s) cause termination.", RoutineName));
    2295              :             }
    2296              :         }
    2297           75 :     }
    2298          120 : }
    2299              : 
    2300          113 : 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          113 :     ErrorObjectHeader eoh{routineName, CurrentModuleObject, Alphas(1)};
    2330              : 
    2331          113 :     auto &thisOARequirements(state.dataSize->OARequirements(OAIndex));
    2332              : 
    2333          113 :     if (NumAlphas > 1) {
    2334          113 :         thisOARequirements.OAFlowMethod = static_cast<OAFlowCalcMethod>(getEnumValue(OAFlowCalcMethodNamesUC, Util::makeUPPER(Alphas(2))));
    2335          113 :         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          113 :     if (NumNumbers > 0) {
    2348          113 :         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            0 :         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          113 :     if (thisOARequirements.OAFlowMethod != OAFlowCalcMethod::PerPerson && thisOARequirements.OAFlowMethod != OAFlowCalcMethod::Sum &&
    2356           22 :         thisOARequirements.OAFlowMethod != OAFlowCalcMethod::Max && thisOARequirements.OAFlowMethod != OAFlowCalcMethod::PCOccSch &&
    2357           20 :         thisOARequirements.OAFlowMethod != OAFlowCalcMethod::PCDesOcc && thisOARequirements.OAFlowMethod != OAFlowCalcMethod::IAQProcedure) {
    2358           20 :         state.dataSize->OARequirements(OAIndex).OAFlowPerPerson = 0.0;
    2359              :     }
    2360              :     // remaining fields default to 0
    2361          113 :     if (NumNumbers > 1) {
    2362          107 :         if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::PerArea || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Sum ||
    2363           48 :             thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Max) {
    2364           61 :             state.dataSize->OARequirements(OAIndex).OAFlowPerArea = Numbers(2);
    2365           46 :         } else if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::PCOccSch || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::PCDesOcc ||
    2366           46 :                    thisOARequirements.OAFlowMethod == OAFlowCalcMethod::IAQProcedure) {
    2367            0 :             state.dataSize->OARequirements(OAIndex).OAFlowPerArea = Numbers(2);
    2368              :         } else {
    2369           46 :             state.dataSize->OARequirements(OAIndex).OAFlowPerArea = 0.0;
    2370              :         }
    2371              :     }
    2372          113 :     if (NumNumbers > 2) {
    2373          104 :         if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::PerZone || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Sum ||
    2374           37 :             thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Max || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::IAQProcedure) {
    2375           69 :             state.dataSize->OARequirements(OAIndex).OAFlowPerZone = Numbers(3);
    2376              :         } else {
    2377           35 :             state.dataSize->OARequirements(OAIndex).OAFlowPerZone = 0.0;
    2378              :         }
    2379              :     }
    2380              : 
    2381          113 :     if (NumNumbers > 3) {
    2382           29 :         if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::ACH || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Sum ||
    2383           15 :             thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Max || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::IAQProcedure) {
    2384           16 :             state.dataSize->OARequirements(OAIndex).OAFlowACH = Numbers(4);
    2385              :         } else {
    2386           13 :             state.dataSize->OARequirements(OAIndex).OAFlowACH = 0.0;
    2387              :         }
    2388              :     }
    2389              : 
    2390              :     // Set default schedule
    2391          113 :     if (NumAlphas <= 2 || lAlphaBlanks(3)) {
    2392           97 :         state.dataSize->OARequirements(OAIndex).oaFlowFracSched = Sched::GetScheduleAlwaysOn(state); // Defaults to constant-1.0
    2393           16 :     } 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           16 :     } 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          113 :     if (NumAlphas <= 3 || lAlphaBlanks(4)) {
    2402            0 :     } 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            0 :     } 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          113 : }
    2410              : 
    2411          101 : 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          101 :     std::string CurrentModuleObject; // for ease in getting objects
    2437          101 :     Array1D_string Alphas;           // Alpha input items for object
    2438          101 :     Array1D_string cAlphaFields;     // Alpha field names
    2439          101 :     Array1D_string cNumericFields;   // Numeric field names
    2440          101 :     Array1D<Real64> Numbers;         // Numeric input items for object
    2441          101 :     Array1D_bool lAlphaBlanks;       // Logical array, alpha field input BLANK = .TRUE.
    2442          101 :     Array1D_bool lNumericBlanks;     // Logical array, numeric field input BLANK = .TRUE.
    2443              : 
    2444          101 :     CurrentModuleObject = "DesignSpecification:ZoneAirDistribution";
    2445          101 :     state.dataSize->NumZoneAirDistribution = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
    2446          101 :     state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, TotalArgs, NumAlphas, NumNumbers);
    2447              : 
    2448          101 :     Alphas.allocate(NumAlphas);
    2449          101 :     cAlphaFields.allocate(NumAlphas);
    2450          101 :     cNumericFields.allocate(NumNumbers);
    2451          101 :     Numbers.dimension(NumNumbers, 0.0);
    2452          101 :     lAlphaBlanks.dimension(NumAlphas, true);
    2453          101 :     lNumericBlanks.dimension(NumNumbers, true);
    2454              : 
    2455          101 :     if (state.dataSize->NumZoneAirDistribution > 0) {
    2456              :         int IOStatus;            // Used in GetObjectItem
    2457           21 :         bool ErrorsFound(false); // If errors detected in input
    2458           21 :         state.dataSize->ZoneAirDistribution.allocate(state.dataSize->NumZoneAirDistribution);
    2459              : 
    2460              :         // Start Loading the zone air distribution input
    2461           42 :         for (int ZADIndex = 1; ZADIndex <= state.dataSize->NumZoneAirDistribution; ++ZADIndex) {
    2462              : 
    2463           21 :             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           21 :             ErrorObjectHeader eoh{routineName, CurrentModuleObject, Alphas(1)};
    2477           21 :             Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound);
    2478              : 
    2479           21 :             state.dataSize->ZoneAirDistribution(ZADIndex).Name = Alphas(1);
    2480              : 
    2481              :             // Zone Air Distribution Effectiveness in Cooling Mode
    2482           21 :             if (NumNumbers > 0) {
    2483           21 :                 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           21 :             if (NumNumbers > 1) {
    2491           21 :                 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           21 :             if (NumNumbers > 2) {
    2499            1 :                 state.dataSize->ZoneAirDistribution(ZADIndex).ZoneSecondaryRecirculation = Numbers(3);
    2500              :             } else {
    2501              :                 // default value
    2502           20 :                 state.dataSize->ZoneAirDistribution(ZADIndex).ZoneSecondaryRecirculation = 0.0;
    2503              :             }
    2504              : 
    2505              :             // Zone Ventilation Efficiency
    2506           21 :             if (NumNumbers > 3) {
    2507            0 :                 state.dataSize->ZoneAirDistribution(ZADIndex).ZoneVentilationEff = Numbers(4);
    2508              :             } else {
    2509              :                 // default value
    2510           21 :                 state.dataSize->ZoneAirDistribution(ZADIndex).ZoneVentilationEff = 0.0;
    2511              :             }
    2512              : 
    2513           21 :             if (NumAlphas <= 1 || lAlphaBlanks(2)) {
    2514            0 :             } 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            0 :             } 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           21 :         Alphas.deallocate();
    2524           21 :         cAlphaFields.deallocate();
    2525           21 :         cNumericFields.deallocate();
    2526           21 :         Numbers.deallocate();
    2527           21 :         lAlphaBlanks.deallocate();
    2528           21 :         lNumericBlanks.deallocate();
    2529              : 
    2530           21 :         if (ErrorsFound) {
    2531            0 :             ShowFatalError(state, format("{}Errors found in input.  Preceding condition(s) cause termination.", RoutineName));
    2532              :         }
    2533              :     }
    2534          101 : }
    2535              : 
    2536           92 : 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           92 :     auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
    2556           92 :     cCurrentModuleObject = "Sizing:Parameters";
    2557           92 :     int NumSizParams = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    2558              : 
    2559           92 :     if (NumSizParams == 1) {
    2560           28 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2561              :                                                                  cCurrentModuleObject,
    2562              :                                                                  1,
    2563           14 :                                                                  state.dataIPShortCut->cAlphaArgs,
    2564              :                                                                  NumAlphas,
    2565           14 :                                                                  state.dataIPShortCut->rNumericArgs,
    2566              :                                                                  NumNumbers,
    2567              :                                                                  IOStatus,
    2568           14 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    2569           14 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    2570           14 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    2571           14 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    2572           14 :         if (state.dataIPShortCut->lNumericFieldBlanks(1) || state.dataIPShortCut->rNumericArgs(1) < 0.0) {
    2573            1 :             state.dataSize->GlobalHeatSizingFactor = 1.0;
    2574              :         } else {
    2575           13 :             state.dataSize->GlobalHeatSizingFactor = state.dataIPShortCut->rNumericArgs(1);
    2576              :         }
    2577           14 :         if (state.dataIPShortCut->lNumericFieldBlanks(2) || state.dataIPShortCut->rNumericArgs(2) < 0.0) {
    2578            1 :             state.dataSize->GlobalCoolSizingFactor = 1.0;
    2579              :         } else {
    2580           13 :             state.dataSize->GlobalCoolSizingFactor = state.dataIPShortCut->rNumericArgs(2);
    2581              :         }
    2582           14 :         if (state.dataIPShortCut->lNumericFieldBlanks(3) || state.dataIPShortCut->rNumericArgs(3) <= 0.0) {
    2583            8 :             state.dataSize->NumTimeStepsInAvg = state.dataGlobal->TimeStepsInHour;
    2584              :         } else {
    2585            6 :             state.dataSize->NumTimeStepsInAvg = int(state.dataIPShortCut->rNumericArgs(3));
    2586              :         }
    2587           78 :     } else if (NumSizParams == 0) {
    2588           78 :         state.dataSize->GlobalHeatSizingFactor = 1.0;
    2589           78 :         state.dataSize->GlobalCoolSizingFactor = 1.0;
    2590           78 :         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           92 :     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           92 :     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           92 :     cCurrentModuleObject = "OutputControl:Sizing:Style";
    2610           92 :     int Temp = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    2611              : 
    2612           92 :     if (Temp == 0) {
    2613           92 :         state.dataIPShortCut->cAlphaArgs(1) = "Comma";
    2614           92 :         state.dataSize->SizingFileColSep = CharComma; // comma
    2615            0 :     } else if (Temp == 1) {
    2616            0 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2617              :                                                                  cCurrentModuleObject,
    2618              :                                                                  1,
    2619            0 :                                                                  state.dataIPShortCut->cAlphaArgs,
    2620              :                                                                  NumAlphas,
    2621            0 :                                                                  state.dataIPShortCut->rNumericArgs,
    2622              :                                                                  NumNumbers,
    2623              :                                                                  IOStatus,
    2624            0 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    2625            0 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    2626            0 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    2627            0 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    2628            0 :         if (state.dataIPShortCut->cAlphaArgs(1) == "COMMA") {
    2629            0 :             state.dataSize->SizingFileColSep = CharComma; // comma
    2630            0 :             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            0 :         print(state.files.eio, "! <Sizing Output Files>,Style\n");
    2647            0 :         print(state.files.eio, "Sizing Output Files,{}\n", state.dataIPShortCut->cAlphaArgs(1));
    2648              :     }
    2649           92 : }
    2650              : 
    2651          105 : 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          105 :     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          105 :     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           84 :         GlobalMiscObject() : ZoneOrZoneListPtr(0), NumOfZones(0), StartPtr(0), ZoneListActive(false)
    2689              :         {
    2690           84 :         }
    2691              :     };
    2692              : 
    2693              :     // Object Data
    2694          105 :     Array1D<ZoneListData> ZoneListNames;
    2695          105 :     Array1D<GlobalMiscObject> SizingZoneObjects;
    2696          105 :     auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
    2697          105 :     cCurrentModuleObject = "Sizing:Zone";
    2698          105 :     NumSizingZoneStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    2699          105 :     SizingZoneObjects.allocate(NumSizingZoneStatements);
    2700              : 
    2701          105 :     if (NumSizingZoneStatements > 0) {
    2702           62 :         errFlag = false;
    2703           62 :         GetZoneAndZoneListNames(state, errFlag, NumZones, ZoneNames, NumZoneLists, ZoneListNames);
    2704              :     }
    2705              : 
    2706          105 :     cCurrentModuleObject = "Sizing:Zone";
    2707          105 :     state.dataSize->NumZoneSizingInput = 0;
    2708          105 :     errFlag = false;
    2709          189 :     for (Item = 1; Item <= NumSizingZoneStatements; ++Item) {
    2710          168 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2711              :                                                                  cCurrentModuleObject,
    2712              :                                                                  Item,
    2713           84 :                                                                  state.dataIPShortCut->cAlphaArgs,
    2714              :                                                                  NumAlphas,
    2715           84 :                                                                  state.dataIPShortCut->rNumericArgs,
    2716              :                                                                  NumNumbers,
    2717              :                                                                  IOStatus,
    2718           84 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    2719           84 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    2720           84 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    2721           84 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    2722           84 :         Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound);
    2723              : 
    2724           84 :         SizingZoneObjects(Item).Name = state.dataIPShortCut->cAlphaArgs(1);
    2725              : 
    2726           84 :         Item1 = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneNames, NumZones);
    2727           84 :         int ZLItem = 0;
    2728           84 :         if (Item1 == 0 && NumZoneLists > 0) {
    2729            0 :             ZLItem = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneListNames);
    2730              :         }
    2731           84 :         if (Item1 > 0) {
    2732           84 :             SizingZoneObjects(Item).StartPtr = state.dataSize->NumZoneSizingInput + 1;
    2733           84 :             ++state.dataSize->NumZoneSizingInput;
    2734           84 :             SizingZoneObjects(Item).NumOfZones = 1;
    2735           84 :             SizingZoneObjects(Item).ZoneListActive = false;
    2736           84 :             SizingZoneObjects(Item).ZoneOrZoneListPtr = Item1;
    2737            0 :         } else if (ZLItem > 0) {
    2738            0 :             SizingZoneObjects(Item).StartPtr = state.dataSize->NumZoneSizingInput + 1;
    2739            0 :             state.dataSize->NumZoneSizingInput += ZoneListNames(ZLItem).NumOfZones;
    2740            0 :             SizingZoneObjects(Item).NumOfZones = ZoneListNames(ZLItem).NumOfZones;
    2741            0 :             SizingZoneObjects(Item).ZoneListActive = true;
    2742            0 :             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          105 :     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          105 :     if (state.dataSize->NumZoneSizingInput > 0) {
    2761           62 :         int NumDesDays = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:DesignDay") +
    2762           62 :                          state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileDays") +
    2763           62 :                          state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileConditionType");
    2764           62 :         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           62 :         state.dataSize->ZoneSizingInput.allocate(state.dataSize->NumZoneSizingInput);
    2769              : 
    2770           62 :         int ZoneSizIndex = 0;
    2771          146 :         for (Item = 1; Item <= NumSizingZoneStatements; ++Item) {
    2772              : 
    2773          168 :             state.dataInputProcessing->inputProcessor->getObjectItem(state,
    2774              :                                                                      cCurrentModuleObject,
    2775              :                                                                      Item,
    2776           84 :                                                                      state.dataIPShortCut->cAlphaArgs,
    2777              :                                                                      NumAlphas,
    2778           84 :                                                                      state.dataIPShortCut->rNumericArgs,
    2779              :                                                                      NumNumbers,
    2780              :                                                                      IOStatus,
    2781           84 :                                                                      state.dataIPShortCut->lNumericFieldBlanks,
    2782           84 :                                                                      state.dataIPShortCut->lAlphaFieldBlanks,
    2783           84 :                                                                      state.dataIPShortCut->cAlphaFieldNames,
    2784           84 :                                                                      state.dataIPShortCut->cNumericFieldNames);
    2785              : 
    2786           84 :             ErrorObjectHeader eoh{routineName, cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)};
    2787              : 
    2788          168 :             for (Item1 = 1; Item1 <= SizingZoneObjects(Item).NumOfZones; ++Item1) {
    2789           84 :                 ++ZoneSizIndex;
    2790           84 :                 auto &zoneSizingIndex = state.dataSize->ZoneSizingInput(ZoneSizIndex);
    2791           84 :                 if (!SizingZoneObjects(Item).ZoneListActive) {
    2792           84 :                     if (SizingZoneObjects(Item).ZoneOrZoneListPtr > 0) {
    2793           84 :                         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            0 :                     if (SizingZoneObjects(Item).ZoneOrZoneListPtr > 0 && ZoneListNames(SizingZoneObjects(Item).ZoneOrZoneListPtr).Zones(Item1) > 0) {
    2800            0 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneName =
    2801            0 :                             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           84 :                 bool const nameEmpty = Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound);
    2808           84 :                 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           84 :                     std::string const &coolingSATMethod = state.dataIPShortCut->cAlphaArgs(2);
    2820           84 :                     if (coolingSATMethod == "SUPPLYAIRTEMPERATURE") {
    2821           84 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnCoolDgnSAMethod = SupplyAirTemperature;
    2822            0 :                     } else if (coolingSATMethod == "TEMPERATUREDIFFERENCE") {
    2823            0 :                         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           84 :                 Real64 lowTempLimit = 0.0;
    2838           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(1)) {
    2839            0 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTemp = 0.0;
    2840           84 :                 } else if (state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnCoolDgnSAMethod == SupplyAirTemperature) {
    2841           84 :                     ReportTemperatureInputError(state, cCurrentModuleObject, 1, lowTempLimit, false, ErrorsFound);
    2842           84 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTemp = state.dataIPShortCut->rNumericArgs(1);
    2843              :                 } else {
    2844            0 :                     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           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(2)) {
    2854           75 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTempDiff = 0.0;
    2855            9 :                 } else if (state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnCoolDgnSAMethod == TemperatureDifference) {
    2856            0 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTempDiff = state.dataIPShortCut->rNumericArgs(2);
    2857              :                 } else {
    2858            9 :                     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           84 :                     std::string const &heatingSATMethod = state.dataIPShortCut->cAlphaArgs(3);
    2868           84 :                     if (heatingSATMethod == "SUPPLYAIRTEMPERATURE") {
    2869           84 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnHeatDgnSAMethod = SupplyAirTemperature;
    2870            0 :                     } else if (heatingSATMethod == "TEMPERATUREDIFFERENCE") {
    2871            0 :                         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           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(3)) {
    2880            0 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTemp = 0.0;
    2881           84 :                 } else if (state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnHeatDgnSAMethod == SupplyAirTemperature) {
    2882           84 :                     ReportTemperatureInputError(state, cCurrentModuleObject, 3, lowTempLimit, false, ErrorsFound);
    2883           84 :                     ReportTemperatureInputError(
    2884           84 :                         state, cCurrentModuleObject, 3, state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTemp, true, ErrorsFound);
    2885           84 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTemp = state.dataIPShortCut->rNumericArgs(3);
    2886              :                 } else {
    2887            0 :                     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           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(4)) {
    2897           80 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTempDiff = 0.0;
    2898            4 :                 } else if (state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnHeatDgnSAMethod == TemperatureDifference) {
    2899            0 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTempDiff = state.dataIPShortCut->rNumericArgs(4);
    2900              :                 } else {
    2901            4 :                     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           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(5)) {
    2909            0 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesHumRat = 0.0;
    2910           84 :                 } 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           84 :                     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           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(6)) {
    2928            0 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesHumRat = 0.0;
    2929           84 :                 } 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           84 :                     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           84 :                 state.dataSize->ZoneSizingInput(ZoneSizIndex).DesignSpecOAObjName = state.dataIPShortCut->cAlphaArgs(4);
    2945              : 
    2946              :                 // Getting zone OA parameters from Design Specification object
    2947           84 :                 if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) {
    2948              :                     int OAIndex =
    2949           82 :                         Util::FindItemInList(state.dataSize->ZoneSizingInput(ZoneSizIndex).DesignSpecOAObjName, state.dataSize->OARequirements);
    2950           82 :                     if (OAIndex > 0) {
    2951           82 :                         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           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(7) || state.dataIPShortCut->rNumericArgs(7) == 0.0) {
    2966           76 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatSizingFactor = state.dataSize->GlobalHeatSizingFactor;
    2967            8 :                 } 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            8 :                     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           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(8) || state.dataIPShortCut->rNumericArgs(8) == 0.0) {
    2981           76 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolSizingFactor = state.dataSize->GlobalCoolSizingFactor;
    2982            8 :                 } 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            8 :                     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           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(9)) {
    3001           27 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolAirFlow = 0.0;
    3002           57 :                 } 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           57 :                     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           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(10)) {
    3020           76 :                     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           76 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlowPerArea = state.dataIPShortCut->rNumericArgs(10);
    3024              :                     }
    3025            8 :                 } 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            8 :                     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           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(11)) {
    3042           78 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlow = 0.0;
    3043            6 :                 } 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            6 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlow = state.dataIPShortCut->rNumericArgs(11);
    3052              :                 }
    3053              :                 //  N12,\field Cooling Minimum Air Flow Fraction
    3054           84 :                 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           84 :                     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           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(13)) {
    3074           27 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatAirFlow = 0.0;
    3075           57 :                 } 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           57 :                     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           84 :                 bool DesHeatMaxAirFlowPerAreaUsrInp = false;
    3093           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(14)) {
    3094           77 :                     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           77 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowPerArea = state.dataIPShortCut->rNumericArgs(14);
    3098              :                     }
    3099            7 :                 } 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            7 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowPerArea = state.dataIPShortCut->rNumericArgs(14);
    3108            7 :                     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           84 :                 bool DesHeatMaxAirFlowUsrInp = false;
    3118           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(15)) {
    3119           75 :                     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           75 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlow = state.dataIPShortCut->rNumericArgs(15);
    3123              :                     }
    3124            9 :                 } 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            9 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlow = state.dataIPShortCut->rNumericArgs(15);
    3133            9 :                     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           84 :                 bool DesHeatMaxAirFlowFracUsrInp = false;
    3142           84 :                 if (state.dataIPShortCut->lNumericFieldBlanks(16)) {
    3143           69 :                     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           69 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowFrac = state.dataIPShortCut->rNumericArgs(16);
    3147              :                     }
    3148           15 :                 } 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           15 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowFrac = state.dataIPShortCut->rNumericArgs(16);
    3157           15 :                     DesHeatMaxAirFlowFracUsrInp = true;
    3158              :                 }
    3159              :                 // make sure the user specified inputs of the previous 3 inputs override the defaults
    3160           84 :                 if (DesHeatMaxAirFlowPerAreaUsrInp || DesHeatMaxAirFlowUsrInp || DesHeatMaxAirFlowFracUsrInp) {
    3161           17 :                     if (!DesHeatMaxAirFlowPerAreaUsrInp) {
    3162           10 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowPerArea = 0.0;
    3163              :                     }
    3164           17 :                     if (!DesHeatMaxAirFlowUsrInp) {
    3165            8 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlow = 0.0;
    3166              :                     }
    3167           17 :                     if (!DesHeatMaxAirFlowFracUsrInp) {
    3168            2 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowFrac = 0.0;
    3169              :                     }
    3170              :                 }
    3171              : 
    3172              :                 //  A7, \field Zone Air Distribution Object Name and add its inputs
    3173           84 :                 if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) {
    3174           14 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneAirDistEffObjName = state.dataIPShortCut->cAlphaArgs(7);
    3175           14 :                     int ObjIndex = Util::FindItemInList(state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneAirDistEffObjName,
    3176           14 :                                                         state.dataSize->ZoneAirDistribution);
    3177           14 :                     if (ObjIndex > 0) {
    3178           14 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneADEffCooling =
    3179           14 :                             state.dataSize->ZoneAirDistribution(ObjIndex).ZoneADEffCooling;
    3180           14 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneADEffHeating =
    3181           14 :                             state.dataSize->ZoneAirDistribution(ObjIndex).ZoneADEffHeating;
    3182           14 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneSecondaryRecirculation =
    3183           14 :                             state.dataSize->ZoneAirDistribution(ObjIndex).ZoneSecondaryRecirculation;
    3184           14 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneAirDistributionIndex = ObjIndex;
    3185           14 :                         state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneVentilationEff =
    3186           14 :                             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           70 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneADEffCooling = 1.0;
    3198           70 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneADEffHeating = 1.0;
    3199           70 :                     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           84 :                 state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolAirDesMethod =
    3205          168 :                     static_cast<AirflowSizingMethod>(getEnumValue(AirflowSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(5))));
    3206           84 :                 assert(state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolAirDesMethod != AirflowSizingMethod::Invalid);
    3207           84 :                 state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatAirDesMethod =
    3208          168 :                     static_cast<AirflowSizingMethod>(getEnumValue(AirflowSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(6))));
    3209           84 :                 assert(state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatAirDesMethod != AirflowSizingMethod::Invalid);
    3210              : 
    3211           84 :                 BooleanSwitch accountForDOAS = getYesNoValue(state.dataIPShortCut->cAlphaArgs(8));
    3212           84 :                 state.dataSize->ZoneSizingInput(ZoneSizIndex).AccountForDOAS = (accountForDOAS == BooleanSwitch::Yes) ? true : false;
    3213              : 
    3214           84 :                 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            8 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASControlStrategy =
    3218           16 :                         static_cast<DataSizing::DOASControl>(getEnumValue(DOASControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(9))));
    3219              : 
    3220            8 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASLowSetpoint = state.dataIPShortCut->rNumericArgs(17);
    3221            8 :                     state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASHighSetpoint = state.dataIPShortCut->rNumericArgs(18);
    3222           13 :                     if (state.dataIPShortCut->rNumericArgs(17) > 0.0 && state.dataIPShortCut->rNumericArgs(18) > 0.0 &&
    3223            5 :                         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           84 :                 zoneSizingIndex.spaceConcurrence = static_cast<DataSizing::SizingConcurrence>(
    3230           84 :                     getEnumValue(DataSizing::SizingConcurrenceNamesUC, state.dataIPShortCut->cAlphaArgs(15)));
    3231           84 :                 zoneSizingIndex.zoneSizingMethod =
    3232           84 :                     static_cast<DataSizing::ZoneSizing>(getEnumValue(DataSizing::ZoneSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(10)));
    3233           84 :                 if (zoneSizingIndex.zoneSizingMethod != ZoneSizing::SensibleOnly) {
    3234            4 :                     zoneSizingIndex.zoneLatentSizing = true;
    3235            4 :                     state.dataHeatBal->DoLatentSizing = true;
    3236              :                 }
    3237           84 :                 zoneSizingIndex.ZnLatCoolDgnSAMethod =
    3238           84 :                     (state.dataIPShortCut->cAlphaArgs(11) == "SUPPLYAIRHUMIDITYRATIO") ? SupplyAirHumidityRatio : HumidityRatioDifference;
    3239           84 :                 zoneSizingIndex.LatentCoolDesHumRat = state.dataIPShortCut->rNumericArgs(19);
    3240           84 :                 zoneSizingIndex.CoolDesHumRatDiff = state.dataIPShortCut->rNumericArgs(20);
    3241           84 :                 zoneSizingIndex.ZnLatHeatDgnSAMethod =
    3242           84 :                     (state.dataIPShortCut->cAlphaArgs(12) == "SUPPLYAIRHUMIDITYRATIO") ? SupplyAirHumidityRatio : HumidityRatioDifference;
    3243           84 :                 zoneSizingIndex.LatentHeatDesHumRat = state.dataIPShortCut->rNumericArgs(21);
    3244           84 :                 zoneSizingIndex.HeatDesHumRatDiff = state.dataIPShortCut->rNumericArgs(22);
    3245              : 
    3246           84 :                 if (NumAlphas <= 12 || state.dataIPShortCut->lAlphaFieldBlanks(13)) {
    3247            0 :                 } 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           84 :                 if (NumAlphas <= 13 || state.dataIPShortCut->lAlphaFieldBlanks(14)) {
    3256            0 :                 } 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            0 :                 } else if (zoneSizingIndex.zoneRHDehumidifySched) {
    3263              :                     // check max and min of each schedule and compare RHHumidify > RHDehumidify and warn
    3264            0 :                     Real64 maxHumidify = zoneSizingIndex.zoneRHHumidifySched->getMaxVal(state);
    3265            0 :                     Real64 minDehumidify = zoneSizingIndex.zoneRHDehumidifySched->getMinVal(state);
    3266            0 :                     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          105 :     if (ErrorsFound) {
    3284            0 :         ShowFatalError(state, format("{}: Errors found in getting input. Program terminates.", cCurrentModuleObject));
    3285              :     }
    3286          105 : }
    3287              : 
    3288          257 : void ReportTemperatureInputError(
    3289              :     EnergyPlusData &state, std::string cObjectName, int const paramNum, Real64 comparisonTemperature, bool const shouldFlagSevere, bool &ErrorsFound)
    3290              : {
    3291          257 :     if (state.dataIPShortCut->rNumericArgs(paramNum) < comparisonTemperature) {
    3292            3 :         if (shouldFlagSevere) { // heating supply air temperature is lower than cooling supply air temperature--not allowed
    3293            1 :             ShowSevereError(state, format("{}=\"{}\" has invalid data.", cObjectName, state.dataIPShortCut->cAlphaArgs(1)));
    3294            2 :             ShowContinueError(state,
    3295            5 :                               format("... incorrect {}=[{:.2R}] is less than {}=[{:.2R}]",
    3296            1 :                                      state.dataIPShortCut->cNumericFieldNames(paramNum),
    3297            1 :                                      state.dataIPShortCut->rNumericArgs(paramNum),
    3298            1 :                                      state.dataIPShortCut->cNumericFieldNames(paramNum - 2),
    3299            1 :                                      state.dataIPShortCut->rNumericArgs(paramNum - 2)));
    3300            2 :             ShowContinueError(state, "This is not allowed.  Please check and revise your input.");
    3301            1 :             ErrorsFound = true;
    3302              :         } else { // then input is lower than comparison temperature--just produce a warning for user to check input
    3303            2 :             ShowWarningError(state, format("{}=\"{}\" has invalid data.", cObjectName, state.dataIPShortCut->cAlphaArgs(1)));
    3304            4 :             ShowContinueError(state,
    3305            6 :                               format("... incorrect {}=[{:.2R}] is less than [{:.2R}]",
    3306            2 :                                      state.dataIPShortCut->cNumericFieldNames(paramNum),
    3307            2 :                                      state.dataIPShortCut->rNumericArgs(paramNum),
    3308              :                                      comparisonTemperature));
    3309            6 :             ShowContinueError(state, "Please check your input to make sure this is correct.");
    3310              :         }
    3311              :     }
    3312          257 : }
    3313              : 
    3314           62 : 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           62 :     auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
    3334           62 :     cCurrentModuleObject = "Zone";
    3335           62 :     NumZones = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    3336           62 :     ZoneNames.allocate(NumZones);
    3337              : 
    3338          155 :     for (int Item = 1; Item <= NumZones; ++Item) {
    3339          186 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    3340              :                                                                  cCurrentModuleObject,
    3341              :                                                                  Item,
    3342           93 :                                                                  state.dataIPShortCut->cAlphaArgs,
    3343              :                                                                  NumAlphas,
    3344           93 :                                                                  state.dataIPShortCut->rNumericArgs,
    3345              :                                                                  NumNumbers,
    3346              :                                                                  IOStatus,
    3347           93 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    3348           93 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    3349           93 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    3350           93 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    3351              :         // validation, but no error
    3352           93 :         Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneNames, Item - 1);
    3353           93 :         if (Found == 0) {
    3354           93 :             ZoneNames(Item) = state.dataIPShortCut->cAlphaArgs(1);
    3355              :         } else {
    3356            0 :             ZoneNames(Item) = "xxxxx";
    3357              :         }
    3358              :     }
    3359              : 
    3360           62 :     cCurrentModuleObject = "ZoneList";
    3361           62 :     NumZoneLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    3362           62 :     ZoneListNames.allocate(NumZoneLists);
    3363              : 
    3364           72 :     for (int Item = 1; Item <= NumZoneLists; ++Item) {
    3365           20 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    3366              :                                                                  cCurrentModuleObject,
    3367              :                                                                  Item,
    3368           10 :                                                                  state.dataIPShortCut->cAlphaArgs,
    3369              :                                                                  NumAlphas,
    3370           10 :                                                                  state.dataIPShortCut->rNumericArgs,
    3371              :                                                                  NumNumbers,
    3372              :                                                                  IOStatus,
    3373           10 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    3374           10 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    3375           10 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    3376           10 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    3377              :         // validation, but no error
    3378           10 :         Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneListNames, Item - 1);
    3379           10 :         if (Found == 0) {
    3380           10 :             ZoneListNames(Item).Name = state.dataIPShortCut->cAlphaArgs(1);
    3381              :         } else {
    3382            0 :             ZoneListNames(Item).Name = "xxxxx";
    3383              :         }
    3384           10 :         ZoneListNames(Item).Zones.allocate(NumAlphas - 1);
    3385           10 :         ZoneListNames(Item).NumOfZones = NumAlphas - 1;
    3386           20 :         for (int Item1 = 2; Item1 <= NumAlphas; ++Item1) {
    3387           10 :             Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(Item1), ZoneNames, NumZones);
    3388           10 :             ZoneListNames(Item).Zones(Item1 - 1) = Found;
    3389              :         }
    3390              :     }
    3391           62 : }
    3392              : 
    3393           91 : 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           91 :     constexpr int iNameAlphaNum = 1;                          // A1, \field AirLoop Name
    3409           91 :     constexpr int iLoadTypeSizeAlphaNum = 2;                  // A2, \field Type of Load to Size On
    3410           91 :     constexpr int iCoolCapControlAlphaNum = 11;               // A11 \field Central Cooling Capacity Control Method
    3411           91 :     constexpr int iDesignOAVolFlowNumericNum = 1;             // N1, \field Design Outdoor Air Flow Rate
    3412           91 :     constexpr int iMinSysAirFlowRatioNumericNum = 2;          // N2, \field Minimum System Air Flow Ratio
    3413           91 :     constexpr int iPreheatDesignTempNumericNum = 3;           // N3, \field Preheat Design Temperature
    3414           91 :     constexpr int iPreheatDesignHumRatNumericNum = 4;         // N4, \field Preheat Design Humidity Ratio
    3415           91 :     constexpr int iPrecoolDesignTempNumericNum = 5;           // N5, \field Precool Design Temperature
    3416           91 :     constexpr int iPrecoolDesignHumRatNumericNum = 6;         // N6, \field Precool Design Humidity Ratio
    3417           91 :     constexpr int iCentralCoolDesignSATempNumericNum = 7;     // N7, \field Central Cooling Design Supply Air Temperature
    3418           91 :     constexpr int iCentralHeatDesignSATempNumericNum = 8;     // N8, \field Central Heating Design Supply Air Temperature
    3419           91 :     constexpr int iSizingOptionAlphaNum = 3;                  //  A3, \field Sizing Option
    3420           91 :     constexpr int i100PercentOACoolingAlphaNum = 4;           //  A4, \field 100% Outdoor Air in Cooling
    3421           91 :     constexpr int i100PercentOAHeatingAlphaNum = 5;           //  A5, \field 100% Outdoor Air in Heating
    3422           91 :     constexpr int iCentralCoolDesignSAHumRatNumericNum = 9;   // N9, \field Central Cooling Design Supply Air Humidity Ratio
    3423           91 :     constexpr int iCentralHeatDesignSAHumRatNumericNum = 10;  // N10, \field Central Heating Design Supply Air Humidity Ratio
    3424           91 :     constexpr int iCoolSAFMAlphaNum = 6;                      // A6, \field Cooling Design Air Flow Method
    3425           91 :     constexpr int iMaxCoolAirVolFlowNumericNum = 11;          // N11, \field Cooling Design Air Flow Rate {m3/s}
    3426           91 :     constexpr int iCoolFlowPerFloorAreaNumericNum = 12;       // N12, \field Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2}
    3427           91 :     constexpr int iCoolFlowPerFracCoolNumericNum = 13;        // N13, \field Fraction of Autosized Design Cooling Supply Air Flow Rate {-}
    3428           91 :     constexpr int iCoolFlowPerCoolCapNumericNum = 14;         // N14, \field Design Supply Air Flow Rate Per Unit Cooling Capacity {m3/s-W}
    3429           91 :     constexpr int iHeatSAFMAlphaNum = 7;                      // A7, \field Heating Design Air Flow Method
    3430           91 :     constexpr int iMaxHeatAirVolFlowNumericNum = 15;          // N15, \field Heating Design Air Flow Rate {m3/s}
    3431           91 :     constexpr int iHeatFlowPerFloorAreaNumericNum = 16;       // N16, \field Supply Air Flow Rate Per Floor Area During Heating Operation {m3/s-m2}
    3432           91 :     constexpr int iHeatFlowPerFracHeatNumericNum = 17;        // N17, \field Fraction of Autosized Design Heating Supply Air Flow Rate {-}
    3433           91 :     constexpr int iHeatFlowPerFracCoolNumericNum = 18;        // N18, \field Fraction of Autosized Design Cooling Supply Air Flow Rate {-}
    3434           91 :     constexpr int iHeatFlowPerHeatCapNumericNum = 19;         // N19, \field Design Supply Air Flow Rate Per Unit Heating Capacity {m3/s-W}
    3435           91 :     constexpr int iSystemOASMethodAlphaNum = 8;               // A8,  \field System Outdoor Air Method
    3436           91 :     constexpr int iZoneMaxOAFractionNumericNum = 20;          // N20, \field Zone Maximum Outdoor Air Fraction
    3437           91 :     constexpr int iCoolCAPMAlphaNum(9);                       // A9, \field Cooling Design Capacity Method
    3438           91 :     constexpr int iCoolDesignCapacityNumericNum(21);          // N21, \field Cooling Design Capacity {W}
    3439           91 :     constexpr int iCoolCapacityPerFloorAreaNumericNum(22);    // N22, \field Cooling Design Capacity Per Floor Area {W/m2}
    3440           91 :     constexpr int iCoolFracOfAutosizedCapacityNumericNum(23); // N23, \field Fraction of Autosized Cooling Design Capacity {-}
    3441           91 :     constexpr int iHeatCAPMAlphaNum(10);                      // A10, \field Heating Design Capacity Method
    3442           91 :     constexpr int iHeatDesignCapacityNumericNum(24);          // N24, \field Heating Design Capacity {W}
    3443           91 :     constexpr int iHeatCapacityPerFloorAreaNumericNum(25);    // N25, \field Heating Design Capacity Per Floor Area {W/m2}
    3444           91 :     constexpr int iHeatFracOfAutosizedCapacityNumericNum(26); // N26, \field Fraction of Autosized Cooling Design Capacity {-}
    3445           91 :     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           91 :     bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine
    3453              : 
    3454           91 :     auto &SysSizInput = state.dataSize->SysSizInput;
    3455              : 
    3456           91 :     state.dataSizingManager->NumAirLoops = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "AirLoopHVAC");
    3457           91 :     auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
    3458           91 :     cCurrentModuleObject = "Sizing:System";
    3459           91 :     state.dataSize->NumSysSizInput = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    3460              : 
    3461           91 :     if (state.dataSize->NumSysSizInput > 0) {
    3462           29 :         int NumDesDays = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:DesignDay") +
    3463           29 :                          state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileDays") +
    3464           29 :                          state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileConditionType");
    3465           29 :         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           29 :         SysSizInput.allocate(state.dataSize->NumSysSizInput);
    3470              :     }
    3471              : 
    3472          120 :     for (SysSizIndex = 1; SysSizIndex <= state.dataSize->NumSysSizInput; ++SysSizIndex) {
    3473           58 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    3474              :                                                                  cCurrentModuleObject,
    3475              :                                                                  SysSizIndex,
    3476           29 :                                                                  state.dataIPShortCut->cAlphaArgs,
    3477              :                                                                  NumAlphas,
    3478           29 :                                                                  state.dataIPShortCut->rNumericArgs,
    3479              :                                                                  NumNumbers,
    3480              :                                                                  IOStatus,
    3481           29 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    3482           29 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    3483           29 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    3484           29 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    3485           29 :         assert(!state.dataIPShortCut->cAlphaArgs(iNameAlphaNum).empty());
    3486              : 
    3487           29 :         SysSizInput(SysSizIndex).AirPriLoopName = state.dataIPShortCut->cAlphaArgs(iNameAlphaNum);
    3488              : 
    3489           29 :         constexpr std::array<std::string_view, static_cast<int>(DataSizing::LoadSizing::Num)> LoadSizingNamesUC{
    3490              :             "SENSIBLE", "LATENT", "TOTAL", "VENTILATIONREQUIREMENT"};
    3491           58 :         SysSizInput(SysSizIndex).loadSizingType = static_cast<DataSizing::LoadSizing>(
    3492           29 :             getEnumValue(LoadSizingNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(iLoadTypeSizeAlphaNum))));
    3493              : 
    3494              :         // assign PeakLoad based on LoadSizing for now
    3495           29 :         if (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Sensible) {
    3496           17 :             SysSizInput(SysSizIndex).coolingPeakLoad = DataSizing::PeakLoad::SensibleCooling;
    3497           23 :         } else if (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Total ||
    3498           11 :                    (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Latent && state.dataHeatBal->DoLatentSizing)) {
    3499            1 :             SysSizInput(SysSizIndex).coolingPeakLoad = DataSizing::PeakLoad::TotalCooling;
    3500              :         } else {
    3501           11 :             SysSizInput(SysSizIndex).coolingPeakLoad = DataSizing::PeakLoad::SensibleCooling;
    3502              :         }
    3503              :         // set the CoolCapControl input
    3504           29 :         constexpr std::array<std::string_view, static_cast<int>(CapacityControl::Num)> CapacityControlNamesUC{"VAV", "BYPASS", "VT", "ONOFF"};
    3505           58 :         SysSizInput(SysSizIndex).CoolCapControl = static_cast<CapacityControl>(
    3506           29 :             getEnumValue(CapacityControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(iCoolCapControlAlphaNum))));
    3507              : 
    3508              :         {
    3509           29 :             std::string const &sizingOption = state.dataIPShortCut->cAlphaArgs(iSizingOptionAlphaNum);
    3510           29 :             if (sizingOption == "COINCIDENT") {
    3511            0 :                 SysSizInput(SysSizIndex).SizingOption = DataSizing::SizingConcurrence::Coincident;
    3512           29 :             } else if (sizingOption == "NONCOINCIDENT") {
    3513           29 :                 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           29 :         BooleanSwitch is100PctOACooling = getYesNoValue(state.dataIPShortCut->cAlphaArgs(i100PercentOACoolingAlphaNum));
    3526           29 :         SysSizInput(SysSizIndex).CoolOAOption = (is100PctOACooling == BooleanSwitch::Yes) ? OAControl::AllOA : OAControl::MinOA;
    3527              : 
    3528           29 :         BooleanSwitch is100PctOAHeating = getYesNoValue(state.dataIPShortCut->cAlphaArgs(i100PercentOAHeatingAlphaNum));
    3529           29 :         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           29 :         if (state.dataIPShortCut->lNumericFieldBlanks(iDesignOAVolFlowNumericNum)) {
    3537            0 :             SysSizInput(SysSizIndex).DesOutAirVolFlow = AutoSize;
    3538           58 :         } else if (state.dataIPShortCut->rNumericArgs(iDesignOAVolFlowNumericNum) < 0.0 &&
    3539           29 :                    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           29 :             SysSizInput(SysSizIndex).DesOutAirVolFlow = state.dataIPShortCut->rNumericArgs(iDesignOAVolFlowNumericNum);
    3548              :         }
    3549           29 :         if (SysSizInput(SysSizIndex).DesOutAirVolFlow == AutoSize) {
    3550           29 :             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           29 :         if (state.dataIPShortCut->lNumericFieldBlanks(iMinSysAirFlowRatioNumericNum)) {
    3560            0 :             SysSizInput(SysSizIndex).SysAirMinFlowRat = 0.0;
    3561           29 :         } else if ((state.dataIPShortCut->rNumericArgs(iMinSysAirFlowRatioNumericNum) < 0.0) &&
    3562            0 :                    (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           29 :             SysSizInput(SysSizIndex).SysAirMinFlowRat = state.dataIPShortCut->rNumericArgs(iMinSysAirFlowRatioNumericNum);
    3572           29 :             if (state.dataIPShortCut->rNumericArgs(iMinSysAirFlowRatioNumericNum) == DataSizing::AutoSize) {
    3573            0 :                 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           29 :         SysSizInput(SysSizIndex).PreheatTemp = state.dataIPShortCut->rNumericArgs(iPreheatDesignTempNumericNum);
    3585           29 :         SysSizInput(SysSizIndex).PreheatHumRat = state.dataIPShortCut->rNumericArgs(iPreheatDesignHumRatNumericNum);
    3586           29 :         SysSizInput(SysSizIndex).PrecoolTemp = state.dataIPShortCut->rNumericArgs(iPrecoolDesignTempNumericNum);
    3587           29 :         SysSizInput(SysSizIndex).PrecoolHumRat = state.dataIPShortCut->rNumericArgs(iPrecoolDesignHumRatNumericNum);
    3588           29 :         SysSizInput(SysSizIndex).CoolSupTemp = state.dataIPShortCut->rNumericArgs(iCentralCoolDesignSATempNumericNum);
    3589           29 :         SysSizInput(SysSizIndex).HeatSupTemp = state.dataIPShortCut->rNumericArgs(iCentralHeatDesignSATempNumericNum);
    3590           29 :         SysSizInput(SysSizIndex).CoolSupHumRat = state.dataIPShortCut->rNumericArgs(iCentralCoolDesignSAHumRatNumericNum);
    3591           29 :         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           29 :         if (state.dataIPShortCut->lNumericFieldBlanks(iMaxCoolAirVolFlowNumericNum)) {
    3607            6 :             SysSizInput(SysSizIndex).DesCoolAirFlow = 0.0;
    3608           23 :         } 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           23 :             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           29 :         if (state.dataIPShortCut->lNumericFieldBlanks(iMaxHeatAirVolFlowNumericNum)) {
    3634            6 :             SysSizInput(SysSizIndex).DesHeatAirFlow = 0.0;
    3635           23 :         } 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           23 :             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           29 :         if (state.dataIPShortCut->lNumericFieldBlanks(iZoneMaxOAFractionNumericNum)) {
    3655            0 :             SysSizInput(SysSizIndex).MaxZoneOAFraction = 0.0;
    3656           29 :         } 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           29 :             SysSizInput(SysSizIndex).MaxZoneOAFraction = state.dataIPShortCut->rNumericArgs(iZoneMaxOAFractionNumericNum);
    3665              :         }
    3666              :         {
    3667           29 :             std::string const &coolAirDesMethod = state.dataIPShortCut->cAlphaArgs(iCoolSAFMAlphaNum);
    3668           29 :             if (coolAirDesMethod == "DESIGNDAY") {
    3669           27 :                 SysSizInput(SysSizIndex).CoolAirDesMethod = AirflowSizingMethod::FromDDCalc;
    3670            2 :             } else if (coolAirDesMethod == "FLOW/SYSTEM") {
    3671            2 :                 SysSizInput(SysSizIndex).CoolAirDesMethod = AirflowSizingMethod::InpDesAirFlow;
    3672            0 :             } 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            0 :             } 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            0 :             } else if (coolAirDesMethod == "FLOWPERCOOLINGCAPACITY") {
    3681            0 :                 SysSizInput(SysSizIndex).CoolAirDesMethod = AirflowSizingMethod::FromDDCalc;
    3682            0 :                 SysSizInput(SysSizIndex).ScaleCoolSAFMethod = FlowPerCoolingCapacity;
    3683            0 :                 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           29 :             std::string const &heatAirDesMethod = state.dataIPShortCut->cAlphaArgs(iHeatSAFMAlphaNum);
    3698           29 :             if (heatAirDesMethod == "DESIGNDAY") {
    3699           27 :                 SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::FromDDCalc;
    3700            2 :             } else if (heatAirDesMethod == "FLOW/SYSTEM") {
    3701            2 :                 SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::InpDesAirFlow;
    3702            0 :             } 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            0 :             } 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            0 :             } 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            0 :             } else if (heatAirDesMethod == "FLOWPERHEATINGCAPACITY") {
    3715            0 :                 SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::FromDDCalc;
    3716            0 :                 SysSizInput(SysSizIndex).ScaleHeatSAFMethod = FlowPerHeatingCapacity;
    3717            0 :                 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           29 :             std::string const &systemOAMethod = state.dataIPShortCut->cAlphaArgs(iSystemOASMethodAlphaNum);
    3732           29 :             if (systemOAMethod == "ZONESUM") {
    3733           24 :                 SysSizInput(SysSizIndex).SystemOAMethod = SysOAMethod::ZoneSum;
    3734            5 :             } else if (systemOAMethod == "STANDARD62.1VENTILATIONRATEPROCEDURE") {
    3735            0 :                 SysSizInput(SysSizIndex).SystemOAMethod = SysOAMethod::VRP;
    3736            0 :                 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            0 :                     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            5 :             } else if (systemOAMethod == "STANDARD62.1SIMPLIFIEDPROCEDURE") {
    3758            5 :                 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           29 :         if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "COOLINGDESIGNCAPACITY")) {
    3772           28 :             SysSizInput(SysSizIndex).CoolingCapMethod = CoolingDesignCapacity;
    3773              :             // SysSizInput( SysSizIndex ).ScaledCoolingCapacity = AutoSize can be set to autosize cooling capacity
    3774           28 :             SysSizInput(SysSizIndex).ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(iCoolDesignCapacityNumericNum);
    3775           28 :             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           29 :         if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "HEATINGDESIGNCAPACITY")) {
    3857           28 :             SysSizInput(SysSizIndex).HeatingCapMethod = HeatingDesignCapacity;
    3858              :             // SysSizInput( SysSizIndex ).ScaledHeatingCapacity = AutoSize can be set to autosize heating capacity
    3859           28 :             SysSizInput(SysSizIndex).ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatDesignCapacityNumericNum);
    3860           28 :             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           29 :         if (state.dataIPShortCut->lNumericFieldBlanks(iOccupantDiversity)) {
    3946           21 :             SysSizInput(SysSizIndex).OccupantDiversity = AutoSize;
    3947           12 :         } else if (state.dataIPShortCut->rNumericArgs(iOccupantDiversity) <= 0.0 &&
    3948            4 :                    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            8 :         } 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            8 :             SysSizInput(SysSizIndex).OccupantDiversity = state.dataIPShortCut->rNumericArgs(iOccupantDiversity);
    3965              :         }
    3966              :     }
    3967              : 
    3968           91 :     if (ErrorsFound) {
    3969            0 :         ShowFatalError(state, format("{}: Errors found in getting input. Program terminates.", cCurrentModuleObject));
    3970              :     }
    3971           91 : }
    3972              : 
    3973          100 : 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          100 :     bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine
    3993          100 :     auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
    3994          100 :     cCurrentModuleObject = "Sizing:Plant";
    3995          100 :     state.dataSize->NumPltSizInput = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    3996              : 
    3997          100 :     if (state.dataSize->NumPltSizInput > 0) {
    3998           23 :         int NumDesDays = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:DesignDay") +
    3999           23 :                          state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileDays") +
    4000           23 :                          state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileConditionType");
    4001           23 :         if (NumDesDays == 0 && state.dataGlobal->DoPlantSizing) {
    4002            0 :             ShowSevereError(state, "Plant Sizing calculations need SizingPeriod:* input");
    4003            0 :             ErrorsFound = true;
    4004              :         }
    4005           23 :         state.dataSize->PlantSizData.allocate(state.dataSize->NumPltSizInput);
    4006           53 :         for (auto &e : state.dataSize->PlantSizData) {
    4007           30 :             e.PlantLoopName.clear();
    4008           30 :             e.ExitTemp = 0.0;
    4009           30 :             e.DeltaT = 0.0;
    4010           30 :             e.LoopType = DataSizing::TypeOfPlantLoop::Invalid;
    4011           30 :             e.DesVolFlowRate = 0.0;
    4012           23 :         }
    4013           53 :         for (int i = 1; i <= state.dataSize->NumPltSizInput; ++i) {
    4014           30 :             state.dataSize->PlantSizData(i).ConcurrenceOption = NonCoincident;
    4015           30 :             state.dataSize->PlantSizData(i).NumTimeStepsInAvg = 1;
    4016              :         }
    4017              :     }
    4018              : 
    4019          130 :     for (PltSizIndex = 1; PltSizIndex <= state.dataSize->NumPltSizInput; ++PltSizIndex) {
    4020           60 :         state.dataInputProcessing->inputProcessor->getObjectItem(state,
    4021              :                                                                  cCurrentModuleObject,
    4022              :                                                                  PltSizIndex,
    4023           30 :                                                                  state.dataIPShortCut->cAlphaArgs,
    4024              :                                                                  NumAlphas,
    4025           30 :                                                                  state.dataIPShortCut->rNumericArgs,
    4026              :                                                                  NumNumbers,
    4027              :                                                                  IOStatus,
    4028           30 :                                                                  state.dataIPShortCut->lNumericFieldBlanks,
    4029           30 :                                                                  state.dataIPShortCut->lAlphaFieldBlanks,
    4030           30 :                                                                  state.dataIPShortCut->cAlphaFieldNames,
    4031           30 :                                                                  state.dataIPShortCut->cNumericFieldNames);
    4032           30 :         Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound);
    4033              : 
    4034           30 :         state.dataSize->PlantSizData(PltSizIndex).PlantLoopName = state.dataIPShortCut->cAlphaArgs(1);
    4035           30 :         state.dataSize->PlantSizData(PltSizIndex).ExitTemp = state.dataIPShortCut->rNumericArgs(1);
    4036           30 :         state.dataSize->PlantSizData(PltSizIndex).DeltaT = state.dataIPShortCut->rNumericArgs(2);
    4037           30 :         if (NumNumbers > 2) {
    4038           12 :             state.dataSize->PlantSizData(PltSizIndex).NumTimeStepsInAvg = state.dataIPShortCut->rNumericArgs(3);
    4039              :         } else {
    4040           18 :             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           30 :         state.dataSize->PlantSizData(PltSizIndex).LoopType =
    4046           60 :             static_cast<TypeOfPlantLoop>(getEnumValue(TypeOfPlantLoopNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2))));
    4047           30 :         assert(state.dataSize->PlantSizData(PltSizIndex).LoopType != TypeOfPlantLoop::Invalid);
    4048              : 
    4049           30 :         if (NumAlphas > 2) {
    4050              :             {
    4051           12 :                 std::string const &concurrenceOption = state.dataIPShortCut->cAlphaArgs(3);
    4052           12 :                 if (concurrenceOption == "NONCOINCIDENT") {
    4053            5 :                     state.dataSize->PlantSizData(PltSizIndex).ConcurrenceOption = NonCoincident;
    4054            7 :                 } else if (concurrenceOption == "COINCIDENT") {
    4055            7 :                     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           30 :         if (NumAlphas > 3) {
    4066              :             {
    4067           12 :                 std::string const &sizingFactorOption = state.dataIPShortCut->cAlphaArgs(4);
    4068           12 :                 if (sizingFactorOption == "NONE") {
    4069           12 :                     state.dataSize->PlantSizData(PltSizIndex).SizingFactorOption = NoSizingFactorMode;
    4070            0 :                 } else if (sizingFactorOption == "GLOBALHEATINGSIZINGFACTOR") {
    4071            0 :                     state.dataSize->PlantSizData(PltSizIndex).SizingFactorOption = GlobalHeatingSizingFactorMode;
    4072            0 :                 } else if (sizingFactorOption == "GLOBALCOOLINGSIZINGFACTOR") {
    4073            0 :                     state.dataSize->PlantSizData(PltSizIndex).SizingFactorOption = GlobalCoolingSizingFactorMode;
    4074            0 :                 } else if (sizingFactorOption == "LOOPCOMPONENTSIZINGFACTOR") {
    4075            0 :                     state.dataSize->PlantSizData(PltSizIndex).SizingFactorOption = LoopComponentSizingFactorMode;
    4076              :                 }
    4077              :             }
    4078              :         }
    4079           30 :         SetupEMSInternalVariable(state,
    4080              :                                  "Plant Design Volume Flow Rate",
    4081           30 :                                  state.dataSize->PlantSizData(PltSizIndex).PlantLoopName,
    4082              :                                  "[m3/s]",
    4083           30 :                                  state.dataSize->PlantSizData(PltSizIndex).DesVolFlowRate);
    4084              :     }
    4085              : 
    4086          100 :     if (ErrorsFound) {
    4087            0 :         ShowFatalError(state, format("{}: Errors found in getting input. Program terminates.", cCurrentModuleObject));
    4088              :     }
    4089          100 : }
    4090              : 
    4091           49 : 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           49 :     bool Available = true;
    4108              : 
    4109           49 :     state.dataSize->CurOverallSimDay = 0;
    4110          139 :     while (Available) { // do for each environment
    4111              : 
    4112          139 :         Weather::GetNextEnvironment(state, Available, ErrorsFound);
    4113              : 
    4114          139 :         if (!Available) {
    4115           49 :             break;
    4116              :         }
    4117           90 :         if (ErrorsFound) {
    4118            0 :             break;
    4119              :         }
    4120              : 
    4121              :         // check that environment is one of the design days
    4122           90 :         if (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) {
    4123            0 :             continue;
    4124              :         }
    4125              : 
    4126           90 :         state.dataGlobal->BeginEnvrnFlag = true;
    4127           90 :         state.dataGlobal->EndEnvrnFlag = false;
    4128           90 :         state.dataEnvrn->EndMonthFlag = false;
    4129           90 :         state.dataGlobal->WarmupFlag = true;
    4130           90 :         state.dataGlobal->DayOfSim = 0;
    4131              : 
    4132           90 :         state.dataSize->CurEnvirNumSimDay = 1;
    4133           90 :         ++state.dataSize->CurOverallSimDay;
    4134              : 
    4135           90 :         ++state.dataGlobal->DayOfSim;
    4136           90 :         state.dataGlobal->BeginDayFlag = true;
    4137           90 :         state.dataGlobal->EndDayFlag = false;
    4138              : 
    4139           90 :         state.dataGlobal->HourOfDay = 1;
    4140              : 
    4141           90 :         state.dataGlobal->BeginHourFlag = true;
    4142           90 :         state.dataGlobal->EndHourFlag = false;
    4143              : 
    4144           90 :         state.dataGlobal->TimeStep = 1;
    4145              : 
    4146           90 :         state.dataGlobal->BeginTimeStepFlag = true;
    4147              : 
    4148           90 :         Weather::ManageWeather(state);
    4149              : 
    4150           90 :         ManageHeatBalance(state);
    4151              : 
    4152           90 :         state.dataGlobal->BeginHourFlag = false;
    4153           90 :         state.dataGlobal->BeginDayFlag = false;
    4154           90 :         state.dataGlobal->BeginEnvrnFlag = false;
    4155           90 :         state.dataGlobal->BeginSimFlag = false;
    4156              : 
    4157              :         //          ! do another timestep=1
    4158           90 :         Weather::ManageWeather(state);
    4159              : 
    4160           90 :         ManageHeatBalance(state);
    4161              : 
    4162              :         //         do an end of day, end of environment time step
    4163              : 
    4164           90 :         state.dataGlobal->HourOfDay = Constant::iHoursInDay;
    4165           90 :         state.dataGlobal->TimeStep = state.dataGlobal->TimeStepsInHour;
    4166           90 :         state.dataGlobal->EndEnvrnFlag = true;
    4167              : 
    4168           90 :         Weather::ManageWeather(state);
    4169              : 
    4170           90 :         ManageHeatBalance(state);
    4171              : 
    4172              :     } // ... End environment loop.
    4173           49 : }
    4174              : 
    4175           91 : 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           91 :     std::string_view const curName = zoneOrSpace.Name;
    4184              :     // shift for predefined reports for space vs zone
    4185           91 :     int shift = 0;
    4186           91 :     if (isSpace) {
    4187           21 :         shift = state.dataOutRptPredefined->pdchSpClCalcDesLd - state.dataOutRptPredefined->pdchZnClCalcDesLd;
    4188              :     }
    4189           91 :     int thisNum = zsFinalSizing.ZoneNum; // Zone or space num
    4190           91 :     if (zsFinalSizing.DesCoolVolFlow > 0.0) {
    4191           89 :         int TimeStepAtPeak = zsFinalSizing.TimeStepNumAtCoolMax;
    4192           89 :         int DDNum = zsFinalSizing.CoolDDNum;
    4193           89 :         Real64 TempAtPeak = 0.0;
    4194           89 :         Real64 HumRatAtPeak = 0.0;
    4195           89 :         Real64 DOASHeatGainRateAtClPk = 0.0;
    4196           89 :         Real64 TStatSetPtAtPk = 0.0;
    4197           89 :         if (DDNum > 0 && TimeStepAtPeak > 0) {
    4198           88 :             TempAtPeak = state.dataSize->DesDayWeath(DDNum).Temp(TimeStepAtPeak);
    4199           88 :             HumRatAtPeak = state.dataSize->DesDayWeath(DDNum).HumRat(TimeStepAtPeak);
    4200           88 :             DOASHeatGainRateAtClPk = zsCalcSizing(DDNum, thisNum).DOASHeatAddSeq(TimeStepAtPeak);
    4201           88 :             TStatSetPtAtPk = zSizing(DDNum, thisNum).CoolTstatTempSeq(TimeStepAtPeak);
    4202              :         } else {
    4203            1 :             TempAtPeak = zsCalcFinalSizing.OutTempAtCoolPeak;
    4204            1 :             HumRatAtPeak = zsCalcFinalSizing.OutHumRatAtCoolPeak;
    4205            1 :             DOASHeatGainRateAtClPk = zsCalcFinalSizing.DOASCoolLoad;
    4206            1 :             TStatSetPtAtPk = zsCalcFinalSizing.ZoneTempAtCoolPeak;
    4207              :         }
    4208           89 :         reportZoneSizingEio(state,
    4209           89 :                             zsFinalSizing.ZoneName,
    4210           89 :                             zsCalcFinalSizing.CoolSizingType,
    4211           89 :                             zsCalcFinalSizing.DesCoolLoad,
    4212           89 :                             zsFinalSizing.DesCoolLoad,
    4213           89 :                             zsCalcFinalSizing.DesCoolVolFlow,
    4214           89 :                             zsFinalSizing.DesCoolVolFlow,
    4215           89 :                             zsFinalSizing.CoolDesDay,
    4216           89 :                             zsCalcFinalSizing.CoolPeakDateHrMin,
    4217              :                             TempAtPeak,
    4218              :                             HumRatAtPeak,
    4219           89 :                             zoneOrSpace.FloorArea,
    4220           89 :                             zoneOrSpace.TotOccupants,
    4221           89 :                             zsFinalSizing.MinOA,
    4222              :                             DOASHeatGainRateAtClPk,
    4223              :                             isSpace);
    4224          178 :         OutputReportPredefined::PreDefTableEntry(
    4225           89 :             state, shift + state.dataOutRptPredefined->pdchZnClCalcDesLd, curName, zsCalcFinalSizing.DesCoolLoad);
    4226           89 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClUserDesLd, curName, zsFinalSizing.DesCoolLoad);
    4227           89 :         if (zoneOrSpace.FloorArea != 0.0) {
    4228          172 :             OutputReportPredefined::PreDefTableEntry(
    4229           86 :                 state, shift + state.dataOutRptPredefined->pdchZnClUserDesLdPerArea, curName, zsFinalSizing.DesCoolLoad / zoneOrSpace.FloorArea);
    4230              :         }
    4231           89 :         OutputReportPredefined::PreDefTableEntry(
    4232           89 :             state, shift + state.dataOutRptPredefined->pdchZnClCalcDesAirFlow, curName, zsCalcFinalSizing.DesCoolVolFlow, 3);
    4233           89 :         OutputReportPredefined::PreDefTableEntry(
    4234           89 :             state, shift + state.dataOutRptPredefined->pdchZnClUserDesAirFlow, curName, zsFinalSizing.DesCoolVolFlow, 3);
    4235           89 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClDesDay, curName, zsFinalSizing.CoolDesDay);
    4236           89 :         OutputReportPredefined::PreDefTableEntry(
    4237           89 :             state, shift + state.dataOutRptPredefined->pdchZnClPkTime, curName, zsCalcFinalSizing.CoolPeakDateHrMin);
    4238           89 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkTstatTemp, curName, TStatSetPtAtPk);
    4239          178 :         OutputReportPredefined::PreDefTableEntry(
    4240           89 :             state, shift + state.dataOutRptPredefined->pdchZnClPkIndTemp, curName, zsCalcFinalSizing.ZoneTempAtCoolPeak);
    4241           89 :         OutputReportPredefined::PreDefTableEntry(
    4242           89 :             state, shift + state.dataOutRptPredefined->pdchZnClPkIndHum, curName, zsCalcFinalSizing.ZoneHumRatAtCoolPeak, 5);
    4243           89 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOATemp, curName, TempAtPeak);
    4244           89 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOAHum, curName, HumRatAtPeak, 5);
    4245           89 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOAMinFlow, curName, zsFinalSizing.MinOA, 3);
    4246           89 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkDOASHeatGain, curName, DOASHeatGainRateAtClPk);
    4247              :     } else {
    4248            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClCalcDesLd, curName, 0.0, 1);
    4249            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClUserDesLd, curName, 0.0, 1);
    4250            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClUserDesLdPerArea, curName, 0.0, 1);
    4251            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClCalcDesAirFlow, curName, 0.0, 1);
    4252            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClUserDesAirFlow, curName, 0.0, 1);
    4253            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClDesDay, curName, "N/A");
    4254            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkTime, curName, "N/A");
    4255            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkTstatTemp, curName, 0.0, 1);
    4256            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkIndTemp, curName, 0.0, 1);
    4257            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkIndHum, curName, 0.0, 1);
    4258            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOATemp, curName, 0.0, 1);
    4259            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOAHum, curName, 0.0, 1);
    4260            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOAMinFlow, curName, 0.0, 1);
    4261            2 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkDOASHeatGain, curName, 0.0, 1);
    4262              :     }
    4263           91 :     if (zsFinalSizing.DesHeatVolFlow > 0.0) {
    4264           77 :         int TimeStepAtPeak = zsFinalSizing.TimeStepNumAtHeatMax;
    4265           77 :         int DDNum = zsFinalSizing.HeatDDNum;
    4266           77 :         Real64 TempAtPeak = 0.0;
    4267           77 :         Real64 HumRatAtPeak = 0.0;
    4268           77 :         Real64 DOASHeatGainRateAtHtPk = 0.0;
    4269           77 :         Real64 TStatSetPtAtPk = 0.0;
    4270           77 :         if (DDNum > 0 && TimeStepAtPeak > 0) {
    4271           77 :             TempAtPeak = state.dataSize->DesDayWeath(DDNum).Temp(TimeStepAtPeak);
    4272           77 :             HumRatAtPeak = state.dataSize->DesDayWeath(DDNum).HumRat(TimeStepAtPeak);
    4273           77 :             DOASHeatGainRateAtHtPk = zsCalcSizing(DDNum, thisNum).DOASHeatAddSeq(TimeStepAtPeak);
    4274           77 :             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           77 :         reportZoneSizingEio(state,
    4282           77 :                             zsFinalSizing.ZoneName,
    4283           77 :                             zsCalcFinalSizing.HeatSizingType,
    4284           77 :                             zsCalcFinalSizing.DesHeatLoad,
    4285           77 :                             zsFinalSizing.DesHeatLoad,
    4286           77 :                             zsCalcFinalSizing.DesHeatVolFlow,
    4287           77 :                             zsFinalSizing.DesHeatVolFlow,
    4288           77 :                             zsFinalSizing.HeatDesDay,
    4289           77 :                             zsCalcFinalSizing.HeatPeakDateHrMin,
    4290              :                             TempAtPeak,
    4291              :                             HumRatAtPeak,
    4292           77 :                             zoneOrSpace.FloorArea,
    4293           77 :                             zoneOrSpace.TotOccupants,
    4294           77 :                             zsFinalSizing.MinOA,
    4295              :                             DOASHeatGainRateAtHtPk,
    4296              :                             isSpace);
    4297          154 :         OutputReportPredefined::PreDefTableEntry(
    4298           77 :             state, shift + state.dataOutRptPredefined->pdchZnHtCalcDesLd, curName, zsCalcFinalSizing.DesHeatLoad);
    4299           77 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtUserDesLd, curName, zsFinalSizing.DesHeatLoad);
    4300           77 :         if (zoneOrSpace.FloorArea != 0.0) {
    4301          152 :             OutputReportPredefined::PreDefTableEntry(
    4302           76 :                 state, shift + state.dataOutRptPredefined->pdchZnHtUserDesLdPerArea, curName, zsFinalSizing.DesHeatLoad / zoneOrSpace.FloorArea);
    4303              :         }
    4304           77 :         OutputReportPredefined::PreDefTableEntry(
    4305           77 :             state, shift + state.dataOutRptPredefined->pdchZnHtCalcDesAirFlow, curName, zsCalcFinalSizing.DesHeatVolFlow, 3);
    4306           77 :         OutputReportPredefined::PreDefTableEntry(
    4307           77 :             state, shift + state.dataOutRptPredefined->pdchZnHtUserDesAirFlow, curName, zsFinalSizing.DesHeatVolFlow, 3);
    4308           77 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtDesDay, curName, zsFinalSizing.HeatDesDay);
    4309           77 :         OutputReportPredefined::PreDefTableEntry(
    4310           77 :             state, shift + state.dataOutRptPredefined->pdchZnHtPkTime, curName, zsCalcFinalSizing.HeatPeakDateHrMin);
    4311           77 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkTstatTemp, curName, TStatSetPtAtPk);
    4312          154 :         OutputReportPredefined::PreDefTableEntry(
    4313           77 :             state, shift + state.dataOutRptPredefined->pdchZnHtPkIndTemp, curName, zsCalcFinalSizing.ZoneTempAtHeatPeak);
    4314           77 :         OutputReportPredefined::PreDefTableEntry(
    4315           77 :             state, shift + state.dataOutRptPredefined->pdchZnHtPkIndHum, curName, zsCalcFinalSizing.ZoneHumRatAtHeatPeak, 5);
    4316           77 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOATemp, curName, TempAtPeak);
    4317           77 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOAHum, curName, HumRatAtPeak, 5);
    4318           77 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOAMinFlow, curName, zsFinalSizing.MinOA, 3);
    4319           77 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkDOASHeatGain, curName, DOASHeatGainRateAtHtPk);
    4320              :     } else {
    4321           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtCalcDesLd, curName, 0.0, 1);
    4322           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtUserDesLd, curName, 0.0, 1);
    4323           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtUserDesLdPerArea, curName, 0.0, 1);
    4324           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtCalcDesAirFlow, curName, 0.0, 1);
    4325           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtUserDesAirFlow, curName, 0.0, 1);
    4326           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtDesDay, curName, "N/A");
    4327           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkTime, curName, "N/A");
    4328           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkTstatTemp, curName, 0.0, 1);
    4329           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkIndTemp, curName, 0.0, 1);
    4330           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkIndHum, curName, 0.0, 1);
    4331           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOATemp, curName, 0.0, 1);
    4332           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOAHum, curName, 0.0, 1);
    4333           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOAMinFlow, curName, 0.0, 1);
    4334           14 :         OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkDOASHeatGain, curName, 0.0, 1);
    4335              :     }
    4336           91 : }
    4337          166 : 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          166 :     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           49 :         print(state.files.eio, "{}\n", Format_990_Zone);
    4370           49 :         state.dataSizingManager->ReportZoneSizingMyOneTimeFlag = false;
    4371              :     }
    4372          166 :     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            7 :         print(state.files.eio, "{}\n", Format_990_Space);
    4379            7 :         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          166 :     if (isSpace) {
    4387           36 :         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          130 :         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          166 :     if (state.dataSQLiteProcedures->sqlite) {
    4424            9 :         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          166 : }
    4439              : 
    4440              : // Writes system sizing data to EIO file using one row per system
    4441           56 : 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           56 :     if (state.dataSizingManager->ReportSysSizingMyOneTimeFlag) {
    4455           28 :         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           28 :         state.dataSizingManager->ReportSysSizingMyOneTimeFlag = false;
    4460              :     }
    4461           56 :     std::string dateHrMin = DesDayDate + " " + TimeIndexToHrMinString(state, TimeStepIndex);
    4462           56 :     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           56 :     if (state.dataSQLiteProcedures->sqlite) {
    4475            4 :         state.dataSQLiteProcedures->sqlite->addSQLiteSystemSizingRecord(
    4476              :             SysName, LoadType, PeakLoadKind, UserDesCap, CalcDesVolFlow, UserDesVolFlow, DesDayName, dateHrMin);
    4477              :     }
    4478              :     // BSLLC Finish
    4479           56 : }
    4480              : 
    4481              : // convert an index for the timestep of the day into a hour minute string in the format 00:00
    4482           71 : std::string TimeIndexToHrMinString(EnergyPlusData const &state, int timeIndex)
    4483              : {
    4484           71 :     int tMinOfDay = timeIndex * state.dataGlobal->MinutesInTimeStep;
    4485           71 :     int tHr = int(tMinOfDay / 60.);
    4486           71 :     int tMin = tMinOfDay - tHr * 60;
    4487          142 :     return format(PeakHrMinFmt, tHr, tMin);
    4488              : }
    4489              : 
    4490           91 : 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           91 :     iCoolSAFMAlphaNum = 2;               // get input index to Zone HVAC sizing heat supp air flow method
    4537           91 :     iMaxCoolAirVolFlowNumericNum = 1;    // get input index to Zone HVAC sizing cool supply air flow
    4538           91 :     iCoolFlowPerFloorAreaNumericNum = 2; // get input index to Zone HVAC sizing cool flow per floor area
    4539           91 :     iCoolFlowPerFracCoolNumericNum = 3;  // get input index to Zone HVAC sizing cool flow per fraction cool
    4540           91 :     iCoolFlowPerCoolCapNumericNum = 4;   // get input index to Zone HVAC sizing cool flow per cooling cap
    4541              : 
    4542           91 :     iNoCoolHeatSAFMAlphaNum = 3;               // get input index to Zone HVAC sizing no cool/heat supply air flow
    4543           91 :     iMaxNoCoolHeatAirVolFlowNumericNum = 5;    // get input index to Zone HVAC sizing no cool/heat supply air flow
    4544           91 :     iNoCoolHeatFlowPerFloorAreaNumericNum = 6; // get input index to Zone HVAC sizing no cool/heat FPA
    4545           91 :     iNoCoolHeatFlowPerFracCoolNumericNum = 7;  // get input index to Zone HVAC sizing no cool/heat FPFC
    4546           91 :     iNoCoolHeatFlowPerFracHeatNumericNum = 8;  // get input index to Zone HVAC sizing no cool/heat FPFH
    4547              : 
    4548           91 :     iHeatSAFMAlphaNum = 4;                // get input index to Zone HVAC sizing cool supp air flow method
    4549           91 :     iMaxHeatAirVolFlowNumericNum = 9;     // get input index to Zone HVAC sizing heat supply air flow
    4550           91 :     iHeatFlowPerFloorAreaNumericNum = 10; // get input index to Zone HVAC sizing heat flow per floor area
    4551           91 :     iHeatFlowPerFracCoolNumericNum = 11;  // get input index to Zone HVAC sizing heat flow per fraction heat
    4552           91 :     iHeatFlowPerHeatCapNumericNum = 12;   // get input index to Zone HVAC sizing heat flow per heating cap
    4553              : 
    4554           91 :     iCoolCAPMAlphaNum = 5;                       // get input index to Zone HVAC sizing cooling design capacity method
    4555           91 :     iCoolDesignCapacityNumericNum = 13;          // get input index to Zone HVAC sizing cooling design capacity
    4556           91 :     iCoolCapacityPerFloorAreaNumericNum = 14;    // get input index to Zone HVAC sizing cooling design capacity per floor area
    4557           91 :     iCoolFracOfAutosizedCapacityNumericNum = 15; // get input index to Zone HVAC sizing as a fraction of cooling design capacity
    4558              : 
    4559           91 :     iHeatCAPMAlphaNum = 6;                       // get input index to Zone HVAC sizing heating capacity
    4560           91 :     iHeatDesignCapacityNumericNum = 16;          // get input index to Zone HVAC sizing heating design capacity
    4561           91 :     iHeatCapacityPerFloorAreaNumericNum = 17;    // get input index to Zone HVAC sizing heating capacity per floor area
    4562           91 :     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           91 :     bool ErrorsFound(false); // If errors detected in input
    4568              :     //  REAL(r64) :: CalcAmt
    4569              : 
    4570           91 :     std::string CurrentModuleObject; // for ease in getting objects
    4571           91 :     Array1D_string Alphas;           // Alpha input items for object
    4572           91 :     Array1D_string cAlphaFields;     // Alpha field names
    4573           91 :     Array1D_string cNumericFields;   // Numeric field names
    4574           91 :     Array1D<Real64> Numbers;         // Numeric input items for object
    4575           91 :     Array1D_bool lAlphaBlanks;       // Logical array, alpha field input BLANK = .TRUE.
    4576           91 :     Array1D_bool lNumericBlanks;     // Logical array, numeric field input BLANK = .TRUE.
    4577              : 
    4578           91 :     CurrentModuleObject = "DesignSpecification:ZoneHVAC:Sizing";
    4579           91 :     state.dataSize->NumZoneHVACSizing = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
    4580           91 :     state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, TotalArgs, NumAlphas, NumNumbers);
    4581              : 
    4582           91 :     Alphas.allocate(NumAlphas);
    4583           91 :     cAlphaFields.allocate(NumAlphas);
    4584           91 :     cNumericFields.allocate(NumNumbers);
    4585           91 :     Numbers.dimension(NumNumbers, 0.0);
    4586           91 :     lAlphaBlanks.dimension(NumAlphas, true);
    4587           91 :     lNumericBlanks.dimension(NumNumbers, true);
    4588              : 
    4589           91 :     if (state.dataSize->NumZoneHVACSizing > 0) {
    4590              :         int IOStatus; // Used in GetObjectItem
    4591            1 :         state.dataSize->ZoneHVACSizing.allocate(state.dataSize->NumZoneHVACSizing);
    4592              : 
    4593              :         // Start Loading the System Input
    4594            2 :         for (int zSIndex = 1; zSIndex <= state.dataSize->NumZoneHVACSizing; ++zSIndex) {
    4595              : 
    4596            2 :             Alphas = "";
    4597            2 :             cAlphaFields = "";
    4598            1 :             cNumericFields = "";
    4599            1 :             Numbers = 0;
    4600            1 :             lAlphaBlanks = true;
    4601            1 :             lNumericBlanks = true;
    4602              : 
    4603            1 :             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            1 :             Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound);
    4616              : 
    4617            1 :             state.dataSize->ZoneHVACSizing(zSIndex).Name = Alphas(1);
    4618              : 
    4619              :             // Determine supply air flow rate sizing method for cooling mode
    4620            1 :             if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "SupplyAirFlowRate")) {
    4621            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = SupplyAirFlowRate;
    4622              : 
    4623            0 :                 if (!lNumericBlanks(iMaxCoolAirVolFlowNumericNum)) {
    4624            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = Numbers(iMaxCoolAirVolFlowNumericNum);
    4625            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow == AutoSize) {
    4626            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4627              :                     }
    4628            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow <= 0.0 &&
    4629            0 :                         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            1 :             } else if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "FlowPerFloorArea")) {
    4643            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = FlowPerFloorArea;
    4644            0 :                 if (!lNumericBlanks(iCoolFlowPerFloorAreaNumericNum)) {
    4645            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = Numbers(iCoolFlowPerFloorAreaNumericNum);
    4646            0 :                     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            0 :                     } 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            0 :                         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            1 :             if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "SupplyAirFlowRate")) {
    4738            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = SupplyAirFlowRate;
    4739            0 :                 if (!lNumericBlanks(iMaxHeatAirVolFlowNumericNum)) {
    4740            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iMaxHeatAirVolFlowNumericNum);
    4741            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow == AutoSize) {
    4742            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4743              :                     }
    4744              : 
    4745            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow <= 0.0 &&
    4746            0 :                         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            1 :             } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "FlowPerFloorArea")) {
    4760            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = FlowPerFloorArea;
    4761            0 :                 if (!lNumericBlanks(iHeatFlowPerFloorAreaNumericNum)) {
    4762            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iHeatFlowPerFloorAreaNumericNum);
    4763            0 :                     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            0 :                     } 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            0 :                         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            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = FractionOfAutosizedHeatingAirflow;
    4789            0 :                 if (!lNumericBlanks(iHeatFlowPerFracCoolNumericNum)) {
    4790            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iHeatFlowPerFracCoolNumericNum);
    4791            0 :                     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            0 :                     } 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            0 :                         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            1 :             } 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            1 :             } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "None") || lAlphaBlanks(iHeatSAFMAlphaNum)) {
    4844            1 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = None;
    4845            1 :                 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            1 :             if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "SupplyAirFlowRate")) {
    4854            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = SupplyAirFlowRate;
    4855            0 :                 if (!lNumericBlanks(iMaxNoCoolHeatAirVolFlowNumericNum)) {
    4856            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iMaxNoCoolHeatAirVolFlowNumericNum);
    4857            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow == AutoSize) {
    4858            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4859              :                     }
    4860            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow < 0.0 &&
    4861            0 :                         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            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = FlowPerFloorArea;
    4877            0 :                 if (!lNumericBlanks(iNoCoolHeatFlowPerFloorAreaNumericNum)) {
    4878            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iNoCoolHeatFlowPerFloorAreaNumericNum);
    4879            0 :                     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            0 :                     } 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            0 :                         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            1 :             } else if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "FractionOfAutosizedCoolingAirflow")) {
    4906            1 :                 state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = FractionOfAutosizedCoolingAirflow;
    4907            1 :                 if (!lNumericBlanks(iNoCoolHeatFlowPerFracCoolNumericNum)) {
    4908            1 :                     state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iNoCoolHeatFlowPerFracCoolNumericNum);
    4909            1 :                     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            1 :                     } 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            1 :                         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            1 :             if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "CoolingDesignCapacity")) {
    4976            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = CoolingDesignCapacity;
    4977            0 :                 if (!lNumericBlanks(iCoolDesignCapacityNumericNum)) {
    4978            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity = Numbers(iCoolDesignCapacityNumericNum);
    4979            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity == AutoSize) {
    4980            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    4981              :                     }
    4982            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity < 0.0 &&
    4983            0 :                         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            1 :             } else if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "CapacityPerFloorArea")) {
    4997            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = CapacityPerFloorArea;
    4998            0 :                 if (!lNumericBlanks(iCoolCapacityPerFloorAreaNumericNum)) {
    4999            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity = Numbers(iCoolCapacityPerFloorAreaNumericNum);
    5000            0 :                     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            0 :                     } 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            1 :             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            1 :             } else if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) {
    5074            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = CapacityPerFloorArea;
    5075            0 :                 if (!lNumericBlanks(iHeatCapacityPerFloorAreaNumericNum)) {
    5076            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity = Numbers(iHeatCapacityPerFloorAreaNumericNum);
    5077            0 :                     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            0 :                     } 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            0 :                 state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = FractionOfAutosizedHeatingCapacity;
    5100            0 :                 if (!lNumericBlanks(iHeatFracOfAutosizedCapacityNumericNum)) {
    5101            0 :                     state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity = Numbers(iHeatFracOfAutosizedCapacityNumericNum);
    5102            0 :                     if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity == AutoSize) {
    5103            0 :                         state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
    5104              :                     }
    5105            0 :                     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            1 :             } else if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "None") || lAlphaBlanks(iHeatCAPMAlphaNum)) {
    5121            1 :                 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           91 :     Alphas.deallocate();
    5131           91 :     cAlphaFields.deallocate();
    5132           91 :     cNumericFields.deallocate();
    5133           91 :     Numbers.deallocate();
    5134           91 :     lAlphaBlanks.deallocate();
    5135           91 :     lNumericBlanks.deallocate();
    5136              : 
    5137           91 :     if (ErrorsFound) {
    5138            0 :         ShowFatalError(state, format("{}Errors found in input.  Preceding condition(s) cause termination.", RoutineName));
    5139              :     }
    5140           91 : }
    5141              : 
    5142           91 : 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           91 :     bool ErrorsFound(false); // If errors detected in input
    5158           91 :     auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
    5159           91 :     cCurrentModuleObject = "DesignSpecification:AirTerminal:Sizing";
    5160           91 :     state.dataSize->NumAirTerminalSizingSpec = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
    5161           91 :     state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, TotalArgs, NumAlphas, NumNumbers);
    5162              : 
    5163           91 :     if (state.dataSize->NumAirTerminalSizingSpec > 0) {
    5164              :         int IOStatus; // Used in GetObjectItem
    5165            0 :         state.dataSize->AirTerminalSizingSpec.allocate(state.dataSize->NumAirTerminalSizingSpec);
    5166              : 
    5167              :         // Start Loading the System Input
    5168            0 :         for (int zSIndex = 1; zSIndex <= state.dataSize->NumAirTerminalSizingSpec; ++zSIndex) {
    5169              : 
    5170            0 :             state.dataInputProcessing->inputProcessor->getObjectItem(state,
    5171              :                                                                      cCurrentModuleObject,
    5172              :                                                                      zSIndex,
    5173            0 :                                                                      state.dataIPShortCut->cAlphaArgs,
    5174              :                                                                      NumAlphas,
    5175            0 :                                                                      state.dataIPShortCut->rNumericArgs,
    5176              :                                                                      NumNumbers,
    5177              :                                                                      IOStatus,
    5178            0 :                                                                      state.dataIPShortCut->lNumericFieldBlanks,
    5179            0 :                                                                      state.dataIPShortCut->lAlphaFieldBlanks,
    5180            0 :                                                                      state.dataIPShortCut->cAlphaFieldNames,
    5181            0 :                                                                      state.dataIPShortCut->cNumericFieldNames);
    5182              : 
    5183            0 :             Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound);
    5184              : 
    5185            0 :             auto &thisATSizing = state.dataSize->AirTerminalSizingSpec(zSIndex);
    5186            0 :             thisATSizing.Name = state.dataIPShortCut->cAlphaArgs(1);
    5187            0 :             thisATSizing.DesSensCoolingFrac = state.dataIPShortCut->rNumericArgs(1);
    5188            0 :             thisATSizing.DesCoolSATRatio = state.dataIPShortCut->rNumericArgs(2);
    5189            0 :             thisATSizing.DesSensHeatingFrac = state.dataIPShortCut->rNumericArgs(3);
    5190            0 :             thisATSizing.DesHeatSATRatio = state.dataIPShortCut->rNumericArgs(4);
    5191            0 :             thisATSizing.MinOAFrac = state.dataIPShortCut->rNumericArgs(5);
    5192              :         }
    5193              :     }
    5194              : 
    5195           91 :     if (ErrorsFound) {
    5196            0 :         ShowFatalError(state, format("{}Errors found in input.  Preceding condition(s) cause termination.", RoutineName));
    5197              :     }
    5198           91 : }
    5199              : 
    5200              : // Update the sizing for the entire facility to gather values for reporting - Glazer January 2017
    5201        12677 : void UpdateFacilitySizing([[maybe_unused]] EnergyPlusData &state, Constant::CallIndicator const CallIndicator)
    5202              : {
    5203        12677 :     int NumOfTimeStepInDay = state.dataGlobal->TimeStepsInHour * Constant::iHoursInDay;
    5204              : 
    5205        12677 :     auto &CalcFacilitySizing = state.dataSize->CalcFacilitySizing;
    5206        12677 :     auto &CalcFinalFacilitySizing = state.dataSize->CalcFinalFacilitySizing;
    5207              : 
    5208              :     //  test if allocated here
    5209        12677 :     if (!CalcFacilitySizing.allocated()) {
    5210           49 :         CalcFacilitySizing.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays);
    5211          139 :         for (int DDNum = 1; DDNum <= state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays; ++DDNum) {
    5212           90 :             CalcFacilitySizing(DDNum).DOASHeatAddSeq.allocate(NumOfTimeStepInDay);
    5213           90 :             CalcFacilitySizing(DDNum).DOASLatAddSeq.allocate(NumOfTimeStepInDay);
    5214           90 :             CalcFacilitySizing(DDNum).CoolOutHumRatSeq.allocate(NumOfTimeStepInDay);
    5215           90 :             CalcFacilitySizing(DDNum).CoolOutTempSeq.allocate(NumOfTimeStepInDay);
    5216           90 :             CalcFacilitySizing(DDNum).CoolZoneTempSeq.allocate(NumOfTimeStepInDay);
    5217           90 :             CalcFacilitySizing(DDNum).CoolLoadSeq.allocate(NumOfTimeStepInDay);
    5218           90 :             CalcFacilitySizing(DDNum).HeatOutHumRatSeq.allocate(NumOfTimeStepInDay);
    5219           90 :             CalcFacilitySizing(DDNum).HeatOutTempSeq.allocate(NumOfTimeStepInDay);
    5220           90 :             CalcFacilitySizing(DDNum).HeatZoneTempSeq.allocate(NumOfTimeStepInDay);
    5221           90 :             CalcFacilitySizing(DDNum).HeatLoadSeq.allocate(NumOfTimeStepInDay);
    5222              : 
    5223           90 :             CalcFacilitySizing(DDNum).DOASHeatAddSeq = 0.;
    5224           90 :             CalcFacilitySizing(DDNum).DOASLatAddSeq = 0.;
    5225           90 :             CalcFacilitySizing(DDNum).CoolOutHumRatSeq = 0.;
    5226           90 :             CalcFacilitySizing(DDNum).CoolOutTempSeq = 0.;
    5227           90 :             CalcFacilitySizing(DDNum).CoolZoneTempSeq = 0.;
    5228           90 :             CalcFacilitySizing(DDNum).CoolLoadSeq = 0.;
    5229           90 :             CalcFacilitySizing(DDNum).HeatOutHumRatSeq = 0.;
    5230           90 :             CalcFacilitySizing(DDNum).HeatOutTempSeq = 0.;
    5231           90 :             CalcFacilitySizing(DDNum).HeatZoneTempSeq = 0.;
    5232           90 :             CalcFacilitySizing(DDNum).HeatLoadSeq = 0.;
    5233              :         }
    5234              :     }
    5235        12677 :     if (!CalcFinalFacilitySizing.DOASHeatAddSeq.allocated()) {
    5236           49 :         CalcFinalFacilitySizing.DOASHeatAddSeq.allocate(NumOfTimeStepInDay);
    5237           49 :         CalcFinalFacilitySizing.DOASLatAddSeq.allocate(NumOfTimeStepInDay);
    5238           49 :         CalcFinalFacilitySizing.CoolOutHumRatSeq.allocate(NumOfTimeStepInDay);
    5239           49 :         CalcFinalFacilitySizing.CoolOutTempSeq.allocate(NumOfTimeStepInDay);
    5240           49 :         CalcFinalFacilitySizing.CoolZoneTempSeq.allocate(NumOfTimeStepInDay);
    5241           49 :         CalcFinalFacilitySizing.CoolLoadSeq.allocate(NumOfTimeStepInDay);
    5242           49 :         CalcFinalFacilitySizing.HeatOutHumRatSeq.allocate(NumOfTimeStepInDay);
    5243           49 :         CalcFinalFacilitySizing.HeatOutTempSeq.allocate(NumOfTimeStepInDay);
    5244           49 :         CalcFinalFacilitySizing.HeatZoneTempSeq.allocate(NumOfTimeStepInDay);
    5245           49 :         CalcFinalFacilitySizing.HeatLoadSeq.allocate(NumOfTimeStepInDay);
    5246              : 
    5247           49 :         CalcFinalFacilitySizing.DOASHeatAddSeq = 0.;
    5248           49 :         CalcFinalFacilitySizing.DOASLatAddSeq = 0.;
    5249           49 :         CalcFinalFacilitySizing.CoolOutHumRatSeq = 0.;
    5250           49 :         CalcFinalFacilitySizing.CoolOutTempSeq = 0.;
    5251           49 :         CalcFinalFacilitySizing.CoolZoneTempSeq = 0.;
    5252           49 :         CalcFinalFacilitySizing.CoolLoadSeq = 0.;
    5253           49 :         CalcFinalFacilitySizing.HeatOutHumRatSeq = 0.;
    5254           49 :         CalcFinalFacilitySizing.HeatOutTempSeq = 0.;
    5255           49 :         CalcFinalFacilitySizing.HeatZoneTempSeq = 0.;
    5256           49 :         CalcFinalFacilitySizing.HeatLoadSeq = 0.;
    5257              :     }
    5258        12677 :     if (CallIndicator == Constant::CallIndicator::BeginDay) {
    5259          102 :         CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatDDNum = state.dataSize->CurOverallSimDay;
    5260          102 :         CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolDDNum = state.dataSize->CurOverallSimDay;
    5261        12575 :     } else if (CallIndicator == Constant::CallIndicator::DuringDay) {
    5262        12316 :         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        12316 :         Real64 sumCoolLoad = 0.;
    5265        12316 :         Real64 sumHeatLoad = 0.;
    5266        12316 :         Real64 wghtdCoolZoneTemp = 0.;
    5267        12316 :         Real64 wghtdHeatZoneTemp = 0.;
    5268        12316 :         Real64 wghtdCoolHumRat = 0.;
    5269        12316 :         Real64 wghtdHeatHumRat = 0.;
    5270        12316 :         Real64 wghtdCoolDOASHeatAdd = 0.;
    5271        12316 :         Real64 wghtdCoolDOASLatAdd = 0.;
    5272        32899 :         for (int CtrlZoneNum = 1; CtrlZoneNum <= state.dataGlobal->NumOfZones; ++CtrlZoneNum) {
    5273        20583 :             if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum).IsControlled) {
    5274         2727 :                 continue;
    5275              :             }
    5276        17856 :             auto const &thisCalcZoneSizing = state.dataSize->CalcZoneSizing(state.dataSize->CurOverallSimDay, CtrlZoneNum);
    5277        17856 :             Real64 curCoolLoad = thisCalcZoneSizing.CoolLoadSeq(TimeStepInDay);
    5278        17856 :             if (curCoolLoad > 0.0) {
    5279         8558 :                 sumCoolLoad += curCoolLoad;
    5280         8558 :                 wghtdCoolZoneTemp += thisCalcZoneSizing.CoolZoneTempSeq(TimeStepInDay) * curCoolLoad;
    5281         8558 :                 wghtdCoolHumRat += thisCalcZoneSizing.CoolZoneHumRatSeq(TimeStepInDay) * curCoolLoad;
    5282         8558 :                 wghtdCoolDOASHeatAdd += thisCalcZoneSizing.DOASHeatAddSeq(TimeStepInDay) * curCoolLoad;
    5283         8558 :                 wghtdCoolDOASLatAdd += thisCalcZoneSizing.DOASLatAddSeq(TimeStepInDay) * curCoolLoad;
    5284              :             }
    5285        17856 :             Real64 curHeatLoad = thisCalcZoneSizing.HeatLoadSeq(TimeStepInDay);
    5286        17856 :             if (curHeatLoad > 0.0) {
    5287         8016 :                 sumHeatLoad += curHeatLoad;
    5288         8016 :                 wghtdHeatZoneTemp += thisCalcZoneSizing.HeatZoneTempSeq(TimeStepInDay) * curHeatLoad;
    5289         8016 :                 wghtdHeatHumRat += thisCalcZoneSizing.HeatZoneHumRatSeq(TimeStepInDay) * curHeatLoad;
    5290              :             }
    5291              :         }
    5292              : 
    5293        12316 :         CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolLoadSeq(TimeStepInDay) = sumCoolLoad;
    5294        12316 :         CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatLoadSeq(TimeStepInDay) = sumHeatLoad;
    5295              : 
    5296        12316 :         if (sumCoolLoad != 0.) {
    5297         6254 :             CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolZoneTempSeq(TimeStepInDay) = wghtdCoolZoneTemp / sumCoolLoad;
    5298         6254 :             CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolOutHumRatSeq(TimeStepInDay) = wghtdCoolHumRat / sumCoolLoad;
    5299         6254 :             CalcFacilitySizing(state.dataSize->CurOverallSimDay).DOASHeatAddSeq(TimeStepInDay) = wghtdCoolDOASHeatAdd / sumCoolLoad;
    5300         6254 :             CalcFacilitySizing(state.dataSize->CurOverallSimDay).DOASLatAddSeq(TimeStepInDay) = wghtdCoolDOASLatAdd / sumCoolLoad;
    5301              :         }
    5302        12316 :         if (sumHeatLoad != 0.) {
    5303         5409 :             CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatZoneTempSeq(TimeStepInDay) = wghtdHeatZoneTemp / sumHeatLoad;
    5304         5409 :             CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatOutHumRatSeq(TimeStepInDay) = wghtdHeatHumRat / sumHeatLoad;
    5305              :         }
    5306              : 
    5307          259 :     } else if (CallIndicator == Constant::CallIndicator::EndDay) {
    5308        24204 :         for (int TimeStepIndex = 1; TimeStepIndex <= NumOfTimeStepInDay; ++TimeStepIndex) {
    5309        24000 :             if (CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolLoadSeq(TimeStepIndex) >
    5310        24000 :                 CalcFacilitySizing(state.dataSize->CurOverallSimDay).DesCoolLoad) {
    5311         1499 :                 CalcFacilitySizing(state.dataSize->CurOverallSimDay).DesCoolLoad =
    5312         1499 :                     CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolLoadSeq(TimeStepIndex);
    5313         1499 :                 CalcFacilitySizing(state.dataSize->CurOverallSimDay).TimeStepNumAtCoolMax = TimeStepIndex;
    5314              :             }
    5315        24000 :             if (CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatLoadSeq(TimeStepIndex) >
    5316        24000 :                 CalcFacilitySizing(state.dataSize->CurOverallSimDay).DesHeatLoad) {
    5317         2612 :                 CalcFacilitySizing(state.dataSize->CurOverallSimDay).DesHeatLoad =
    5318         2612 :                     CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatLoadSeq(TimeStepIndex);
    5319         2612 :                 CalcFacilitySizing(state.dataSize->CurOverallSimDay).TimeStepNumAtHeatMax = TimeStepIndex;
    5320              :             }
    5321              :         }
    5322              : 
    5323           55 :     } else if (CallIndicator == Constant::CallIndicator::EndZoneSizingCalc) {
    5324          157 :         for (int DDNum = 1; DDNum <= state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays; ++DDNum) {
    5325          102 :             if (CalcFacilitySizing(DDNum).DesCoolLoad > CalcFinalFacilitySizing.DesCoolLoad) {
    5326           47 :                 CalcFinalFacilitySizing.DesCoolLoad = CalcFacilitySizing(DDNum).DesCoolLoad;
    5327           47 :                 CalcFinalFacilitySizing.TimeStepNumAtCoolMax = CalcFacilitySizing(DDNum).TimeStepNumAtCoolMax;
    5328           47 :                 CalcFinalFacilitySizing.CoolDDNum = CalcFacilitySizing(DDNum).CoolDDNum;
    5329         5831 :                 for (int TimeStepIndex = 1; TimeStepIndex <= NumOfTimeStepInDay; ++TimeStepIndex) {
    5330         5784 :                     CalcFinalFacilitySizing.CoolOutHumRatSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).CoolOutHumRatSeq(TimeStepIndex);
    5331         5784 :                     CalcFinalFacilitySizing.CoolOutTempSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).CoolOutTempSeq(TimeStepIndex);
    5332         5784 :                     CalcFinalFacilitySizing.CoolZoneTempSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).CoolZoneTempSeq(TimeStepIndex);
    5333         5784 :                     CalcFinalFacilitySizing.DOASHeatAddSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).DOASHeatAddSeq(TimeStepIndex);
    5334         5784 :                     CalcFinalFacilitySizing.DOASLatAddSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).DOASLatAddSeq(TimeStepIndex);
    5335              :                 }
    5336              :             }
    5337          102 :             if (CalcFacilitySizing(DDNum).DesHeatLoad > CalcFinalFacilitySizing.DesHeatLoad) {
    5338           45 :                 CalcFinalFacilitySizing.DesHeatLoad = CalcFacilitySizing(DDNum).DesHeatLoad;
    5339           45 :                 CalcFinalFacilitySizing.TimeStepNumAtHeatMax = CalcFacilitySizing(DDNum).TimeStepNumAtHeatMax;
    5340           45 :                 CalcFinalFacilitySizing.HeatDDNum = CalcFacilitySizing(DDNum).HeatDDNum;
    5341         5325 :                 for (int TimeStepIndex = 1; TimeStepIndex <= NumOfTimeStepInDay; ++TimeStepIndex) {
    5342         5280 :                     CalcFinalFacilitySizing.HeatOutHumRatSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).HeatOutHumRatSeq(TimeStepIndex);
    5343         5280 :                     CalcFinalFacilitySizing.HeatOutTempSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).HeatOutTempSeq(TimeStepIndex);
    5344         5280 :                     CalcFinalFacilitySizing.HeatZoneTempSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).HeatZoneTempSeq(TimeStepIndex);
    5345              :                 }
    5346              :             }
    5347              :         }
    5348              :     }
    5349        12677 : }
    5350              : 
    5351           52 : 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          127 :     for (int termUnitSizingIndex = 1; termUnitSizingIndex <= state.dataSize->NumAirTerminalUnits; ++termUnitSizingIndex) {
    5358           75 :         auto &thisTUFZSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
    5359           75 :         auto &thisTUSizing = state.dataSize->TermUnitSizing(termUnitSizingIndex);
    5360           75 :         int ctrlZoneNum = thisTUSizing.CtrlZoneNum;
    5361           75 :         auto const &thisFZSizing = state.dataSize->FinalZoneSizing(ctrlZoneNum);
    5362              : 
    5363              :         // Copy everything from FinalZoneSizing to TermUnitFinalZoneSizing
    5364           75 :         thisTUFZSizing.copyFromZoneSizing(thisFZSizing);
    5365           75 :         thisTUFZSizing.ADUName = thisTUSizing.ADUName;
    5366              : 
    5367           75 :         if (state.dataSize->NumAirTerminalSizingSpec > 0) {
    5368              :             // Apply DesignSpecification:AirTerminal:Sizing adjustments - default ratios are 1.0
    5369            3 :             Real64 minOAFrac = thisTUSizing.SpecMinOAFrac;
    5370              :             // Outdoor air
    5371            3 :             thisTUFZSizing.MinOA = thisFZSizing.MinOA * minOAFrac;
    5372            3 :             thisTUFZSizing.TotalOAFromPeople = thisFZSizing.TotalOAFromPeople * minOAFrac;
    5373            3 :             thisTUFZSizing.TotalOAFromArea = thisFZSizing.TotalOAFromArea * minOAFrac;
    5374            3 :             Real64 minOACoolMassFlow = thisTUFZSizing.MinOA * thisFZSizing.DesCoolDens;
    5375            3 :             Real64 minOAHeatMassFlow = thisTUFZSizing.MinOA * thisFZSizing.DesHeatDens;
    5376              :             // Cooling
    5377            3 :             Real64 coolFlowRatio = 1.0;
    5378            3 :             if (thisTUSizing.SpecDesCoolSATRatio > 0.0) {
    5379            3 :                 coolFlowRatio = thisTUSizing.SpecDesSensCoolingFrac / thisTUSizing.SpecDesCoolSATRatio;
    5380              :             } else {
    5381            0 :                 coolFlowRatio = thisTUSizing.SpecDesSensCoolingFrac;
    5382              :             }
    5383            3 :             Real64 coolLoadRatio = thisTUSizing.SpecDesSensCoolingFrac;
    5384            3 :             thisTUFZSizing.DesCoolLoad = thisFZSizing.DesCoolLoad * coolLoadRatio;
    5385            3 :             thisTUFZSizing.NonAirSysDesCoolLoad = thisFZSizing.NonAirSysDesCoolLoad * coolLoadRatio;
    5386            3 :             thisTUFZSizing.NonAirSysDesCoolVolFlow = thisFZSizing.NonAirSysDesCoolVolFlow * coolFlowRatio;
    5387              :             // Adjust DesCoolVolFlow, DesCoolMassFlow, and CoolFlowSeq with cooling frac, SAT ratio, and minOA frac adjustments
    5388            3 :             thisTUFZSizing.DesCoolVolFlow = thisTUSizing.applyTermUnitSizingCoolFlow(thisFZSizing.DesCoolVolFlow, thisFZSizing.DesCoolVolFlowNoOA);
    5389            3 :             thisTUFZSizing.DesCoolVolFlow = max(thisTUFZSizing.DesCoolVolFlow, thisTUFZSizing.MinOA);
    5390            3 :             thisTUFZSizing.DesCoolVolFlowNoOA = thisFZSizing.DesCoolVolFlowNoOA * coolFlowRatio;
    5391            3 :             thisTUFZSizing.DesCoolMassFlow = thisTUFZSizing.DesCoolVolFlow * thisFZSizing.DesCoolDens;
    5392            3 :             thisTUFZSizing.DesCoolMassFlow = max(thisTUFZSizing.DesCoolMassFlow, minOACoolMassFlow);
    5393            3 :             thisTUFZSizing.DesCoolMassFlowNoOA = thisTUFZSizing.DesCoolVolFlowNoOA * thisFZSizing.DesCoolDens;
    5394          291 :             for (int timeIndex = 1; timeIndex <= (state.dataGlobal->TimeStepsInHour * Constant::iHoursInDay); ++timeIndex) {
    5395          576 :                 thisTUFZSizing.CoolFlowSeq(timeIndex) =
    5396          288 :                     thisTUSizing.applyTermUnitSizingCoolFlow(thisFZSizing.CoolFlowSeq(timeIndex), thisFZSizing.CoolFlowSeqNoOA(timeIndex));
    5397          288 :                 thisTUFZSizing.CoolFlowSeq(timeIndex) = max(thisTUFZSizing.CoolFlowSeq(timeIndex), minOACoolMassFlow);
    5398          288 :                 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            3 :             thisTUFZSizing.DesCoolMinAirFlow =
    5402            3 :                 thisFZSizing.DesCoolMinAirFlow * thisTUSizing.SpecDesSensCoolingFrac; // no SAT adjustment, this is a straight flow rate input
    5403            3 :             thisTUFZSizing.DesCoolMinAirFlow2 =
    5404            3 :                 thisFZSizing.DesCoolMinAirFlow2 * thisTUSizing.SpecDesSensCoolingFrac; // no SAT adjustment, this is based on area
    5405            6 :             thisTUFZSizing.DesCoolVolFlowMin = max(thisTUFZSizing.DesCoolMinAirFlow,
    5406              :                                                    thisTUFZSizing.DesCoolMinAirFlow2,
    5407            3 :                                                    thisTUFZSizing.DesCoolVolFlow * thisTUFZSizing.DesCoolMinAirFlowFrac);
    5408              : 
    5409              :             // Heating
    5410            3 :             Real64 heatFlowRatio = 1.0;
    5411            3 :             if (thisTUSizing.SpecDesHeatSATRatio > 0.0) {
    5412            3 :                 heatFlowRatio = thisTUSizing.SpecDesSensHeatingFrac / thisTUSizing.SpecDesHeatSATRatio;
    5413              :             } else {
    5414            0 :                 heatFlowRatio = thisTUSizing.SpecDesSensHeatingFrac;
    5415              :             }
    5416            3 :             Real64 heatLoadRatio = thisTUSizing.SpecDesSensHeatingFrac;
    5417            3 :             thisTUFZSizing.DesHeatLoad = thisFZSizing.DesHeatLoad * heatLoadRatio;
    5418            3 :             thisTUFZSizing.NonAirSysDesHeatLoad = thisFZSizing.NonAirSysDesHeatLoad * heatLoadRatio;
    5419            3 :             thisTUFZSizing.NonAirSysDesHeatVolFlow = thisFZSizing.NonAirSysDesHeatVolFlow * heatFlowRatio;
    5420              :             // Adjust DesHeatVolFlow, DesHeatMassFlow, and HeatFlowSeq with Heating frac, SAT ratio, and minOA frac adjustments
    5421            3 :             thisTUFZSizing.DesHeatVolFlow = thisTUSizing.applyTermUnitSizingHeatFlow(thisFZSizing.DesHeatVolFlow, thisFZSizing.DesHeatVolFlowNoOA);
    5422            3 :             thisTUFZSizing.DesHeatVolFlow = max(thisTUFZSizing.DesHeatVolFlow, thisTUFZSizing.MinOA);
    5423            3 :             thisTUFZSizing.DesHeatVolFlowNoOA = thisFZSizing.DesHeatVolFlowNoOA * heatFlowRatio;
    5424            3 :             thisTUFZSizing.DesHeatMassFlow = thisTUFZSizing.DesHeatVolFlow * thisFZSizing.DesHeatDens;
    5425            3 :             thisTUFZSizing.DesHeatMassFlow = max(thisTUFZSizing.DesHeatMassFlow, minOAHeatMassFlow);
    5426            3 :             thisTUFZSizing.DesHeatMassFlowNoOA = thisTUFZSizing.DesHeatVolFlowNoOA * thisFZSizing.DesHeatDens;
    5427          291 :             for (int timeIndex = 1; timeIndex <= (state.dataGlobal->TimeStepsInHour * Constant::iHoursInDay); ++timeIndex) {
    5428          576 :                 thisTUFZSizing.HeatFlowSeq(timeIndex) =
    5429          288 :                     thisTUSizing.applyTermUnitSizingHeatFlow(thisFZSizing.HeatFlowSeq(timeIndex), thisFZSizing.HeatFlowSeqNoOA(timeIndex));
    5430          288 :                 thisTUFZSizing.HeatFlowSeq(timeIndex) = max(thisTUFZSizing.HeatFlowSeq(timeIndex), minOAHeatMassFlow);
    5431          288 :                 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            3 :             thisTUFZSizing.DesHeatMaxAirFlow =
    5435            3 :                 thisFZSizing.DesHeatMaxAirFlow * thisTUSizing.SpecDesSensHeatingFrac; // no SAT adjustment, this is a straight flow rate input
    5436            3 :             thisTUFZSizing.DesHeatMaxAirFlow2 =
    5437            3 :                 thisFZSizing.DesHeatMaxAirFlow2 * thisTUSizing.SpecDesSensHeatingFrac; // no SAT adjustment, this is based on area
    5438            3 :             thisTUFZSizing.DesHeatVolFlowMax =
    5439            3 :                 max(thisTUFZSizing.DesHeatMaxAirFlow,
    5440              :                     thisTUFZSizing.DesHeatMaxAirFlow2,
    5441            3 :                     max(thisTUFZSizing.DesCoolVolFlow, thisTUFZSizing.DesHeatVolFlow) * thisTUFZSizing.DesHeatMaxAirFlowFrac);
    5442              :             // Outdoor air fractions
    5443            3 :             if (thisTUFZSizing.DesCoolVolFlow > 0.0) {
    5444            3 :                 thisTUFZSizing.DesCoolOAFlowFrac = min(thisFZSizing.MinOA / thisTUFZSizing.DesCoolVolFlow, 1.0);
    5445              :             } else {
    5446            0 :                 thisTUFZSizing.DesCoolOAFlowFrac = 0.0;
    5447              :             }
    5448            3 :             if (thisTUFZSizing.DesHeatVolFlow > 0.0) {
    5449            3 :                 thisTUFZSizing.DesHeatOAFlowFrac = min(thisFZSizing.MinOA / thisTUFZSizing.DesHeatVolFlow, 1.0);
    5450              :             } else {
    5451            0 :                 thisTUFZSizing.DesHeatOAFlowFrac = 0.0;
    5452              :             }
    5453              :         }
    5454              :     }
    5455           52 : }
    5456              : } // namespace EnergyPlus::SizingManager
        

Generated by: LCOV version 2.0-1