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

Generated by: LCOV version 2.0-1