LCOV - code coverage report
Current view: top level - EnergyPlus - TARCOGOutput.cc (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 17 544 3.1 %
Date: 2023-01-17 19:17:23 Functions: 4 9 44.4 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2023, 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             : // ObjexxFCL Headers
      49             : #include <ObjexxFCL/string.functions.hh>
      50             : #include <ObjexxFCL/time.hh>
      51             : 
      52             : // EnergyPlus Headers
      53             : #include <EnergyPlus/Data/EnergyPlusData.hh>
      54             : #include <EnergyPlus/DataGlobals.hh>
      55             : #include <EnergyPlus/TARCOGCommon.hh>
      56             : #include <EnergyPlus/TARCOGGassesParams.hh>
      57             : #include <EnergyPlus/TARCOGOutput.hh>
      58             : #include <EnergyPlus/TARCOGParams.hh>
      59             : 
      60             : namespace EnergyPlus::TARCOGOutput {
      61             : 
      62             : // MODULE INFORMATION:
      63             : //       AUTHOR         Simon Vidanovic
      64             : //       DATE WRITTEN   June/22/2010
      65             : //       MODIFIED       na
      66             : //       RE-ENGINEERED  na
      67             : 
      68             : //  Revision: 6.0.36  (June/22/2010)
      69             : //   - Initial setup, extracted from TARCOG.for
      70             : 
      71             : // PURPOSE OF THIS MODULE:
      72             : // A module which contains debug dump subroutines
      73             : 
      74             : // Using/Aliasing
      75             : using namespace TARCOGCommon;
      76             : using namespace TARCOGGassesParams;
      77             : using namespace TARCOGParams;
      78             : 
      79           0 : void WriteInputArguments(EnergyPlusData &state,
      80             :                          InputOutputFile &InArgumentsFile,
      81             :                          const fs::path &DBGD,
      82             :                          Real64 const tout,
      83             :                          Real64 const tind,
      84             :                          Real64 const trmin,
      85             :                          Real64 const wso,
      86             :                          int const iwd,
      87             :                          Real64 const wsi,
      88             :                          Real64 const dir,
      89             :                          Real64 const outir,
      90             :                          int const isky,
      91             :                          Real64 const tsky,
      92             :                          Real64 const esky,
      93             :                          Real64 const fclr,
      94             :                          Real64 const VacuumPressure,
      95             :                          Real64 const VacuumMaxGapThickness,
      96             :                          const Array1D_int &ibc,
      97             :                          Real64 const hout,
      98             :                          Real64 const hin,
      99             :                          TARCOGGassesParams::Stdrd const standard,
     100             :                          TARCOGThermalModel const ThermalMod,
     101             :                          Real64 const SDScalar,
     102             :                          Real64 const height,
     103             :                          Real64 const heightt,
     104             :                          Real64 const width,
     105             :                          Real64 const tilt,
     106             :                          Real64 const totsol,
     107             :                          int const nlayer,
     108             :                          const Array1D<TARCOGParams::TARCOGLayerType> &LayerType,
     109             :                          const Array1D<Real64> &thick,
     110             :                          const Array1D<Real64> &scon,
     111             :                          const Array1D<Real64> &asol,
     112             :                          const Array1D<Real64> &tir,
     113             :                          const Array1D<Real64> &emis,
     114             :                          const Array1D<Real64> &Atop,
     115             :                          const Array1D<Real64> &Abot,
     116             :                          const Array1D<Real64> &Al,
     117             :                          const Array1D<Real64> &Ar,
     118             :                          const Array1D<Real64> &Ah,
     119             :                          const Array1D<Real64> &SlatThick,
     120             :                          const Array1D<Real64> &SlatWidth,
     121             :                          const Array1D<Real64> &SlatAngle,
     122             :                          const Array1D<Real64> &SlatCond,
     123             :                          const Array1D<Real64> &SlatSpacing,
     124             :                          const Array1D<Real64> &SlatCurve,
     125             :                          const Array1D_int &nslice,
     126             :                          const Array1D<Real64> &LaminateA,
     127             :                          const Array1D<Real64> &LaminateB,
     128             :                          const Array1D<Real64> &sumsol,
     129             :                          const Array1D<Real64> &gap,
     130             :                          const Array1D<Real64> &vvent,
     131             :                          const Array1D<Real64> &tvent,
     132             :                          const Array1D<Real64> &presure,
     133             :                          const Array1D_int &nmix,
     134             :                          Array2A_int const iprop,
     135             :                          Array2A<Real64> const frct,
     136             :                          Array2A<Real64> const xgcon,
     137             :                          Array2A<Real64> const xgvis,
     138             :                          Array2A<Real64> const xgcp,
     139             :                          const Array1D<Real64> &xwght)
     140             : {
     141             : 
     142             :     // Using/Aliasing
     143             :     // Argument array dimensioning
     144           0 :     EP_SIZE_CHECK(ibc, 2);
     145           0 :     EP_SIZE_CHECK(LayerType, maxlay);
     146           0 :     EP_SIZE_CHECK(thick, maxlay);
     147           0 :     EP_SIZE_CHECK(scon, maxlay);
     148           0 :     EP_SIZE_CHECK(asol, maxlay);
     149           0 :     EP_SIZE_CHECK(tir, maxlay2);
     150           0 :     EP_SIZE_CHECK(emis, maxlay2);
     151           0 :     EP_SIZE_CHECK(Atop, maxlay);
     152           0 :     EP_SIZE_CHECK(Abot, maxlay);
     153           0 :     EP_SIZE_CHECK(Al, maxlay);
     154           0 :     EP_SIZE_CHECK(Ar, maxlay);
     155           0 :     EP_SIZE_CHECK(Ah, maxlay);
     156           0 :     EP_SIZE_CHECK(SlatThick, maxlay);
     157           0 :     EP_SIZE_CHECK(SlatWidth, maxlay);
     158           0 :     EP_SIZE_CHECK(SlatAngle, maxlay);
     159           0 :     EP_SIZE_CHECK(SlatCond, maxlay);
     160           0 :     EP_SIZE_CHECK(SlatSpacing, maxlay);
     161           0 :     EP_SIZE_CHECK(SlatCurve, maxlay);
     162           0 :     EP_SIZE_CHECK(nslice, maxlay);
     163           0 :     EP_SIZE_CHECK(LaminateA, maxlay);
     164           0 :     EP_SIZE_CHECK(LaminateB, maxlay);
     165           0 :     EP_SIZE_CHECK(sumsol, maxlay);
     166           0 :     EP_SIZE_CHECK(gap, maxlay);
     167           0 :     EP_SIZE_CHECK(vvent, maxlay1);
     168           0 :     EP_SIZE_CHECK(tvent, maxlay1);
     169           0 :     EP_SIZE_CHECK(presure, maxlay1);
     170           0 :     EP_SIZE_CHECK(nmix, maxlay1);
     171           0 :     iprop.dim(maxgas, maxlay1);
     172           0 :     frct.dim(maxgas, maxlay1);
     173           0 :     xgcon.dim(3, maxgas);
     174           0 :     xgvis.dim(3, maxgas);
     175           0 :     xgcp.dim(3, maxgas);
     176           0 :     EP_SIZE_CHECK(xwght, maxgas);
     177             : 
     178             :     // Locals
     179           0 :     Array1D_int DATE_TIME(8);
     180           0 :     Array1D_string real_CLOCK(3);
     181             : 
     182             :     int i;
     183             :     int j;
     184             : 
     185             :     // Formats
     186             :     static constexpr std::string_view Format_1000("TARCOG input arguments:\n");
     187             :     static constexpr std::string_view Format_1001("TARCOG debug output, {:4}-{:02}-{:02}, {:02}:{:02}:{:02}\n");
     188             :     static constexpr std::string_view Format_1002("     WindowID:{:8}  - Not specified\n");
     189             :     static constexpr std::string_view Format_1003("     WindowID:{:8} \n");
     190             :     static constexpr std::string_view Format_1006("     IGUID:   {:8}  - Not specified\n");
     191             :     static constexpr std::string_view Format_1007("     IGUID:   {:8} \n");
     192             :     static constexpr std::string_view Format_1005("Simulation parameters:\n");
     193             :     static constexpr std::string_view Format_1010("  Tout       =  {:10.6F} K ( {:7.3F} deg C) - Outdoor temperature\n");
     194             :     static constexpr std::string_view Format_1015("  Tint       =  {:10.6F} K ( {:7.3F} deg C) - Indoor temperature\n");
     195             :     static constexpr std::string_view Format_1020("  Trmin      =  {:10.6F} K ( {:7.3F} deg C) - Indoor mean radiant temp.\n");
     196             :     static constexpr std::string_view Format_1030("  wso        =  {:7.3F}    - Outdoor wind speed [m/s]\n");
     197             :     static constexpr std::string_view Format_1032("  iwd        =    0        - Wind direction - windward\n");
     198             :     static constexpr std::string_view Format_1033("  iwd        =    1        - Wind direction - leeward\n");
     199             :     static constexpr std::string_view Format_1035("  wsi        =  {:7.3F}    - Indoor forced air speed [m/s]\n");
     200             :     static constexpr std::string_view Format_1040("  dir        = {:8.3F}    - Direct solar radiation [W/m^2]\n");
     201             :     static constexpr std::string_view Format_1041("  outir       = {:8.3F}    - IR radiation [W/m^2]\n");
     202             :     static constexpr std::string_view Format_1045("  isky       =  {:3}        - Flag for handling tsky, esky\n");
     203             :     static constexpr std::string_view Format_1050("  tsky           =  {:10.6F} K ( {:7.3F} deg C) - Night sky temperature\n");
     204             :     static constexpr std::string_view Format_1055("  esky           =  {:7.3F}    - Effective night sky emmitance\n");
     205             :     static constexpr std::string_view Format_1060("  fclr           =  {:7.3F}    - Fraction of sky that is clear\n");
     206             :     static constexpr std::string_view Format_1061("  VacuumPressure =  {:7.3F}    - maximum allowed gas pressure to be considered as vacuum\n");
     207             :     static constexpr std::string_view Format_1062(
     208             :         "  VacuumMaxGapThickness =  {:7.3F}    - maximum allowed vacuum gap thickness with support pillar\n");
     209             :     static constexpr std::string_view Format_1063("  ibc(1)         =  {:3}        - Outdoor BC switch\n");
     210             :     static constexpr std::string_view Format_1065("  hout           =  {:9.5F}  - Outdoor film coeff. [W/m^2-K]\n");
     211             :     static constexpr std::string_view Format_1066("  ibc(2)         =  {:3}        - Indoor BC switch\n");
     212             :     static constexpr std::string_view Format_1068("  hin            =  {:9.5F}  - Indoor film coeff. [W/m^2-K]\n");
     213             :     static constexpr std::string_view Format_1070("  standard   =  {:3}        - ISO 15099 calc. standard\n");
     214             :     static constexpr std::string_view Format_1071("  standard   =  {:3}        - EN 673/ISO 10292 Declared calc. standard\n");
     215             :     static constexpr std::string_view Format_1072("  standard   =  {:3}        - EN 673/ISO 10292 Design calc. standard\n");
     216             :     static constexpr std::string_view Format_10731("  ThermalMod =  {:3}        - ISO15099 thermal model\n");
     217             :     static constexpr std::string_view Format_10732("  ThermalMod =  {:3}        - Scaled Cavity Width (SCW) thermal model\n");
     218             :     static constexpr std::string_view Format_10733("  ThermalMod =  {:3}        - Convective Scalar Model (CSM) thermal model\n");
     219             :     static constexpr std::string_view Format_10740("  SDScalar =  {:7.5F}      - Factor of Venetian SD layer contribution to convection\n\n (only if "
     220             :                                                    "ThermalModel = 2, otherwise ignored)\n");
     221             :     static constexpr std::string_view Format_1075("IGU parameters:\n");
     222             :     static constexpr std::string_view Format_1076("  height     =  {:10.6F} - IGU cavity height [m]\n");
     223             :     static constexpr std::string_view Format_1077("  heightt    =  {:10.6F} - Total window height [m]\n");
     224             :     static constexpr std::string_view Format_1078("  width      =  {:10.6F} - Window width [m]\n");
     225             :     static constexpr std::string_view Format_1079("  tilt       =  {:7.3F}    - Window tilt [deg]\n");
     226             :     static constexpr std::string_view Format_1080("  totsol     =  {:10.6F} - Total solar transmittance of IGU\n");
     227             :     static constexpr std::string_view Format_1081("  nlayer     =  {:3}        - Number of glazing layers\n");
     228             :     static constexpr std::string_view Format_1089("IGU layers list:\n");
     229             :     static constexpr std::string_view Format_10802(" Layer{:3} : {:1}              - Specular layer - Monolyhtic Glass\n");
     230             :     static constexpr std::string_view Format_10803(" Layer{:3} : {:1}              - Laminated Glass\n");
     231             :     static constexpr std::string_view Format_10804(" Layer{:3} : {:1}              - Horizontal Venetian Blind\n");
     232             :     static constexpr std::string_view Format_10805(" Layer{:3} : {:1}              - Woven Shade\n");
     233             :     static constexpr std::string_view Format_10806(" Layer{:3} : {:1}              - Diffuse Shade\n");
     234             :     static constexpr std::string_view Format_10809(" Layer{:3} : {:1}              - UNKNOWN TYPE!\n");
     235             :     static constexpr std::string_view Format_10810(" Layer{:3} : {:1}              - Vertical Venetian Blind\n");
     236             :     static constexpr std::string_view Format_1085("    nslice     = {:3}          - Number of slices\n");
     237             :     static constexpr std::string_view Format_1090("    thick   = {:10.6F}   - Thickness [m]\n");
     238             :     static constexpr std::string_view Format_1091("    scon    = {:10.6F}   - Thermal conductivity [W/m-K]\n");
     239             :     static constexpr std::string_view Format_1092("    asol    = {:12.8F} - Absorbed solar energy [W/m^2]\n");
     240             :     static constexpr std::string_view Format_1093("    tir     = {:12.8F} - IR transmittance\n");
     241             :     static constexpr std::string_view Format_1094("    emis1   = {:10.6F}   - IR outdoor emissivity\n");
     242             :     static constexpr std::string_view Format_1095("    emis2   = {:10.6F}   - IR indoor emissivity\n");
     243             :     static constexpr std::string_view Format_1100("    Atop    = {:10.6F}   - Top opening area [m^2]\n");
     244             :     static constexpr std::string_view Format_1101("    Abot    = {:10.6F}   - Bottom opening area [m^2]\n");
     245             :     static constexpr std::string_view Format_1102("    Al      = {:10.6F}   - Left opening area [m^2]\n");
     246             :     static constexpr std::string_view Format_1103("    Ar      = {:10.6F}   - Right opening area [m^2]\n");
     247             :     static constexpr std::string_view Format_1105("    Ah      = {:10.6F}   - Total area of holes [m^2]\n");
     248             :     static constexpr std::string_view Format_11051("    SlatThick   = {:10.6F}   - Slat thickness [m]\n");
     249             :     static constexpr std::string_view Format_11052("    SlatWidth   = {:10.6F}   - Slat width [m]\n");
     250             :     static constexpr std::string_view Format_11053("    SlatAngle   = {:10.6F}   - Slat tilt angle [deg]\n");
     251             :     static constexpr std::string_view Format_11054("    SlatCond    = {:10.6F}   - Conductivity of the slat material [W/m.K]\n");
     252             :     static constexpr std::string_view Format_11055("    SlatSpacing = {:10.6F}   - Distance between slats [m]\n");
     253             :     static constexpr std::string_view Format_11056("    SlatCurve   = {:10.6F}   - Curvature radius of the slat [m]\n");
     254             :     static constexpr std::string_view Format_1110("IGU Gaps:\n");
     255             :     static constexpr std::string_view Format_1111(" Gap {:2}:\n");
     256             :     static constexpr std::string_view Format_11110(" Outdoor space:\n");
     257             :     static constexpr std::string_view Format_11111(" Indoor space:\n");
     258             :     static constexpr std::string_view Format_1112("    gap        = {:12.5F} - Gap width [m]\n");
     259             :     static constexpr std::string_view Format_1113("    presure    = {:12.5F} - Gas pressure [N/m^2]\n");
     260             :     static constexpr std::string_view Format_1114("    nmix       = {:6}       - Num. of gasses in a gas mix\n");
     261             :     static constexpr std::string_view Format_1115("      Gas {:1}:     {}     {:6.2F} %\n");
     262             :     static constexpr std::string_view Format_1120("    vvent      = {:12.5F} - Forced ventilation speed [m/s]\n");
     263             :     static constexpr std::string_view Format_1121("    tvent      = {:12.5F} - Temperature in connected gap [K]\n");
     264             :     static constexpr std::string_view Format_1130("      Gas mix coefficients - gas {:1}, {:6.2F} %\n");
     265             :     static constexpr std::string_view Format_1131("        gcon   = {:11.6F}, {:11.6F}, {:11.6F} - Conductivity\n");
     266             :     static constexpr std::string_view Format_1132("        gvis   = {:11.6F}, {:11.6F}, {:11.6F} - Dynamic viscosity\n");
     267             :     static constexpr std::string_view Format_1133("        gcp    = {:11.6F}, {:11.6F}, {:11.6F} - Spec.heat @ const.P\n");
     268             :     static constexpr std::string_view Format_1134("        wght   = {:11.6F}                           - Molecular weight\n");
     269             :     static constexpr std::string_view Format_1198("=====  =====  =====  =====  =====  =====  =====  =====  =====  =====  =====\n");
     270             : 
     271             :     // bi...Create debug file w/ Tarcog's input arguments:
     272             : 
     273             :     // File is not open and nothing cannot be written
     274           0 :     if (!InArgumentsFile.good()) return;
     275             : 
     276           0 :     date_and_time(real_CLOCK(1), real_CLOCK(2), real_CLOCK(3), DATE_TIME);
     277             : 
     278           0 :     print(InArgumentsFile, "\n");
     279           0 :     print(InArgumentsFile, Format_1001, DATE_TIME(1), DATE_TIME(2), DATE_TIME(3), DATE_TIME(5), DATE_TIME(6), DATE_TIME(7));
     280           0 :     print(InArgumentsFile, "\n");
     281             : 
     282           0 :     if (state.dataTARCOGOutputs->winID == -1) {
     283           0 :         print(InArgumentsFile, Format_1002, state.dataTARCOGOutputs->winID);
     284             :     } else {
     285           0 :         print(InArgumentsFile, Format_1003, state.dataTARCOGOutputs->winID);
     286             :     }
     287             : 
     288           0 :     if (state.dataTARCOGOutputs->iguID == -1) {
     289           0 :         print(InArgumentsFile, Format_1006, state.dataTARCOGOutputs->iguID);
     290             :     } else {
     291           0 :         print(InArgumentsFile, Format_1007, state.dataTARCOGOutputs->iguID);
     292             :     }
     293             : 
     294           0 :     print(InArgumentsFile, "     Debug dir:     {}\n", DBGD.string());
     295             : 
     296           0 :     print(InArgumentsFile, "\n");
     297           0 :     print(InArgumentsFile, Format_1000);
     298           0 :     print(InArgumentsFile, "\n");
     299           0 :     print(InArgumentsFile, Format_1005);
     300           0 :     print(InArgumentsFile, Format_1010, tout, tout - DataGlobalConstants::KelvinConv);
     301           0 :     print(InArgumentsFile, Format_1015, tind, tind - DataGlobalConstants::KelvinConv);
     302           0 :     print(InArgumentsFile, Format_1020, trmin, trmin - DataGlobalConstants::KelvinConv);
     303           0 :     print(InArgumentsFile, Format_1030, wso);
     304           0 :     if (iwd == 0) print(InArgumentsFile, Format_1032); // windward
     305           0 :     if (iwd == 1) print(InArgumentsFile, Format_1033); // leeward
     306           0 :     print(InArgumentsFile, Format_1035, wsi);
     307           0 :     print(InArgumentsFile, Format_1040, dir);
     308           0 :     print(InArgumentsFile, Format_1041, outir);
     309           0 :     print(InArgumentsFile, Format_1045, isky);
     310           0 :     print(InArgumentsFile, Format_1050, tsky, tsky - DataGlobalConstants::KelvinConv);
     311           0 :     print(InArgumentsFile, Format_1055, esky);
     312           0 :     print(InArgumentsFile, Format_1060, fclr);
     313           0 :     print(InArgumentsFile, Format_1061, VacuumPressure);
     314           0 :     print(InArgumentsFile, Format_1062, VacuumMaxGapThickness);
     315           0 :     print(InArgumentsFile, Format_1063, ibc(1));
     316           0 :     print(InArgumentsFile, Format_1065, hout);
     317           0 :     print(InArgumentsFile, Format_1066, ibc(2));
     318           0 :     print(InArgumentsFile, Format_1068, hin);
     319             : 
     320           0 :     if (standard == TARCOGGassesParams::Stdrd::ISO15099) print(InArgumentsFile, Format_1070, standard);
     321           0 :     if (standard == TARCOGGassesParams::Stdrd::EN673) print(InArgumentsFile, Format_1071, standard);
     322           0 :     if (standard == TARCOGGassesParams::Stdrd::EN673Design) print(InArgumentsFile, Format_1072, standard);
     323             : 
     324           0 :     if (ThermalMod == TARCOGThermalModel::ISO15099) {
     325           0 :         print(InArgumentsFile, Format_10731, ThermalMod);
     326           0 :         print(InArgumentsFile, Format_10740, SDScalar);
     327             :     }
     328             : 
     329           0 :     if (ThermalMod == TARCOGThermalModel::SCW) {
     330           0 :         print(InArgumentsFile, Format_10732, ThermalMod);
     331           0 :         print(InArgumentsFile, Format_10740, SDScalar);
     332             :     }
     333             : 
     334           0 :     if (ThermalMod == TARCOGThermalModel::CSM) {
     335           0 :         print(InArgumentsFile, Format_10733, ThermalMod);
     336           0 :         print(InArgumentsFile, Format_10740, SDScalar);
     337             :     }
     338             : 
     339           0 :     print(InArgumentsFile, "\n");
     340             : 
     341           0 :     print(InArgumentsFile, Format_1075);
     342           0 :     print(InArgumentsFile, Format_1076, height);
     343           0 :     print(InArgumentsFile, Format_1077, heightt);
     344           0 :     print(InArgumentsFile, Format_1078, width);
     345           0 :     print(InArgumentsFile, Format_1079, tilt);
     346           0 :     print(InArgumentsFile, Format_1080, totsol);
     347           0 :     print(InArgumentsFile, Format_1081, nlayer);
     348           0 :     print(InArgumentsFile, "\n");
     349             : 
     350           0 :     print(InArgumentsFile, Format_1089);
     351           0 :     for (i = 1; i <= nlayer; ++i) {
     352           0 :         switch (LayerType(i)) {
     353           0 :         case TARCOGLayerType::DIFFSHADE: { // Diffuse Shade
     354           0 :             print(InArgumentsFile, Format_10806, i, LayerType(i));
     355           0 :         } break;
     356           0 :         case TARCOGLayerType::WOVSHADE: { // Woven Shade
     357           0 :             print(InArgumentsFile, Format_10805, i, LayerType(i));
     358           0 :         } break;
     359           0 :         case TARCOGLayerType::VENETBLIND_HORIZ: { // Horizontal venetian blind
     360           0 :             print(InArgumentsFile, Format_10804, i, LayerType(i));
     361           0 :         } break;
     362           0 :         case TARCOGLayerType::VENETBLIND_VERT: { // Vertical venetian blind
     363           0 :             print(InArgumentsFile, Format_10810, i, LayerType(i));
     364           0 :         } break;
     365           0 :         case TARCOGLayerType::SPECULAR: { // Specular layer
     366           0 :             if (nslice(i) <= 1) {
     367           0 :                 print(InArgumentsFile, Format_10802, i, LayerType(i)); // Monolithic glass
     368             :             } else {
     369           0 :                 print(InArgumentsFile, Format_10803, i, LayerType(i)); // Laminated layer
     370             :             }
     371           0 :         } break;
     372           0 :         default: {
     373           0 :             print(InArgumentsFile, Format_10809, i, LayerType(i));
     374           0 :         } break;
     375             :         }
     376             : 
     377           0 :         print(InArgumentsFile, Format_1090, thick(i));
     378           0 :         print(InArgumentsFile, Format_1091, scon(i));
     379           0 :         print(InArgumentsFile, Format_1092, asol(i));
     380           0 :         print(InArgumentsFile, Format_1093, tir(2 * i - 1));
     381           0 :         print(InArgumentsFile, Format_1094, emis(2 * i - 1));
     382           0 :         print(InArgumentsFile, Format_1095, emis(2 * i));
     383             : 
     384           0 :         if (LayerType(i) == TARCOGLayerType::VENETBLIND_HORIZ || LayerType(i) == TARCOGLayerType::VENETBLIND_VERT) { // SD layer
     385           0 :             print(InArgumentsFile, Format_1100, Atop(i));
     386           0 :             print(InArgumentsFile, Format_1101, Abot(i));
     387           0 :             print(InArgumentsFile, Format_1102, Al(i));
     388           0 :             print(InArgumentsFile, Format_1103, Ar(i));
     389           0 :             print(InArgumentsFile, Format_1105, Ah(i));
     390             : 
     391           0 :             print(InArgumentsFile, Format_11051, SlatThick(i));
     392           0 :             print(InArgumentsFile, Format_11052, SlatWidth(i));
     393           0 :             print(InArgumentsFile, Format_11053, SlatAngle(i));
     394           0 :             print(InArgumentsFile, Format_11054, SlatCond(i));
     395           0 :             print(InArgumentsFile, Format_11055, SlatSpacing(i));
     396           0 :             print(InArgumentsFile, Format_11056, SlatCurve(i));
     397             :         }
     398             : 
     399           0 :         if (nslice(i) > 1) { // SD layer
     400           0 :             print(InArgumentsFile, Format_1085, nslice(i));
     401           0 :             print(InArgumentsFile, Format_1085, LaminateA(i));
     402           0 :             print(InArgumentsFile, Format_1085, LaminateB(i));
     403           0 :             print(InArgumentsFile, Format_1085, sumsol(i));
     404             :         }
     405             :     } // i - layers
     406             : 
     407           0 :     print(InArgumentsFile, "\n");
     408             : 
     409           0 :     print(InArgumentsFile, Format_1110);
     410             : 
     411           0 :     for (i = 1; i <= nlayer + 1; ++i) { // loop through gaps:
     412           0 :         if ((i > 1) && (i <= nlayer)) print(InArgumentsFile, Format_1111, i - 1);
     413           0 :         if (i == 1) print(InArgumentsFile, Format_11110);
     414           0 :         if (i == nlayer + 1) print(InArgumentsFile, Format_11111);
     415           0 :         if ((i > 1) && (i <= nlayer)) print(InArgumentsFile, Format_1112, gap(i - 1));
     416           0 :         print(InArgumentsFile, Format_1113, presure(i));
     417           0 :         if ((i > 1) && (i <= nlayer)) {
     418           0 :             print(InArgumentsFile, Format_1120, vvent(i));
     419             :         }
     420           0 :         if ((i > 1) && (i <= nlayer)) {
     421           0 :             print(InArgumentsFile, Format_1121, tvent(i));
     422             :         }
     423           0 :         print(InArgumentsFile, Format_1114, nmix(i));
     424             : 
     425           0 :         for (j = 1; j <= nmix(i); ++j) {
     426             :             // if (iprop(i, j).eq.1) write(InArgumentsFile, 1115) iprop(i, j), ' ' 100*frct(i, j) ! Air
     427           0 :             print(InArgumentsFile, Format_1115, iprop(j, i), ' ', 100 * frct(j, i)); // gas
     428             :             // if (iprop(i, j).eq.2) write(InArgumentsFile, 1116) iprop(i, j), 100*frct(i, j) ! Argon
     429             :             // if (iprop(i, j).eq.3) write(InArgumentsFile, 1117) iprop(i, j), 100*frct(i, j) ! Krypton
     430             :             // if (iprop(i, j).eq.4) write(InArgumentsFile, 1118) iprop(i, j), 100*frct(i, j) ! Xenon
     431           0 :             print(InArgumentsFile, Format_1130, iprop(j, i), 100 * frct(j, i));
     432           0 :             print(InArgumentsFile, Format_1131, xgcon(1, iprop(j, i)), xgcon(2, iprop(j, i)), xgcon(3, iprop(j, i)));
     433           0 :             print(InArgumentsFile, Format_1132, xgvis(1, iprop(j, i)), xgvis(2, iprop(j, i)), xgvis(3, iprop(j, i)));
     434           0 :             print(InArgumentsFile, Format_1133, xgcp(1, iprop(j, i)), xgcp(2, iprop(j, i)), xgcp(3, iprop(j, i)));
     435           0 :             print(InArgumentsFile, Format_1134, xwght(iprop(j, i)));
     436             :         } // - j - one mix
     437             :     }     // i - gas loop
     438             : 
     439           0 :     print(InArgumentsFile, "\n");
     440           0 :     print(InArgumentsFile, Format_1198);
     441             : }
     442             : 
     443           0 : void WriteModifiedArguments(InputOutputFile &InArgumentsFile,
     444             :                             [[maybe_unused]] fs::path const &DBGD,
     445             :                             Real64 const esky,
     446             :                             Real64 const trmout,
     447             :                             Real64 const trmin,
     448             :                             Real64 const ebsky,
     449             :                             Real64 const ebroom,
     450             :                             Real64 const Gout,
     451             :                             Real64 const Gin,
     452             :                             int const nlayer,
     453             :                             const Array1D<TARCOGParams::TARCOGLayerType> &LayerType,
     454             :                             const Array1D_int &nmix,
     455             :                             Array2A<Real64> const frct,
     456             :                             const Array1D<Real64> &thick,
     457             :                             const Array1D<Real64> &scon,
     458             :                             const Array1D<Real64> &gap,
     459             :                             Array2A<Real64> const xgcon,
     460             :                             Array2A<Real64> const xgvis,
     461             :                             Array2A<Real64> const xgcp,
     462             :                             const Array1D<Real64> &xwght)
     463             : {
     464             : 
     465             :     // Using/Aliasing
     466             :     // Argument array dimensioning
     467           0 :     EP_SIZE_CHECK(LayerType, maxlay);
     468           0 :     EP_SIZE_CHECK(nmix, maxlay1);
     469           0 :     frct.dim(maxgas, maxlay1);
     470           0 :     EP_SIZE_CHECK(thick, maxlay);
     471           0 :     EP_SIZE_CHECK(scon, maxlay);
     472           0 :     EP_SIZE_CHECK(gap, MaxGap);
     473           0 :     xgcon.dim(3, maxgas);
     474           0 :     xgvis.dim(3, maxgas);
     475           0 :     xgcp.dim(3, maxgas);
     476           0 :     EP_SIZE_CHECK(xwght, maxgas);
     477             : 
     478             :     // Locals
     479             :     int i;
     480             :     int j;
     481             : 
     482             :     // Formats
     483             :     static constexpr std::string_view Format_1014("Adjusted input arguments:\n");
     484             :     static constexpr std::string_view Format_1013(" Gass coefficients:\n");
     485             :     static constexpr std::string_view Format_1016("  Trmout     =  {:10.6F} K ( {:7.3F} deg C) - Outdoor mean radiant temp.\n");
     486             :     static constexpr std::string_view Format_1017("  Gout       =  {:10.6F} \n");
     487             :     static constexpr std::string_view Format_1018("  Gin        =  {:10.6F} \n");
     488             :     static constexpr std::string_view Format_1019("  Ebsky      =  {:10.6F} \n");
     489             :     static constexpr std::string_view Format_10191("  Ebroom     =  {:10.6F} \n");
     490             :     static constexpr std::string_view Format_1020("  Trmin      =  {:10.6F} K ( {:7.3F} deg C) - Indoor mean radiant temp.\n");
     491             :     static constexpr std::string_view Format_1055("  esky       =  {:7.3F}    - Effective night sky emmitance\n");
     492             :     static constexpr std::string_view Format_1084(" Layer{:3} : {:1}              - Venetian Blind\n");
     493             :     static constexpr std::string_view Format_1090("    thick   = {:10.6F}   - Thickness [m]\n");
     494             :     static constexpr std::string_view Format_1091("    scon    = {:10.6F}   - Thermal conductivity [W/m-K]\n");
     495             :     static constexpr std::string_view Format_1130("      Gas mix coefficients - gas {:1}, {:6.2F} %\n");
     496             :     static constexpr std::string_view Format_1131("        gcon   = {:11.6F}, {:11.6F}, {:11.6F} - Conductivity\n");
     497             :     static constexpr std::string_view Format_1132("        gvis   = {:11.6F}, {:11.6F}, {:11.6F} - Dynamic viscosity\n");
     498             :     static constexpr std::string_view Format_1133("        gcp    = {:11.6F}, {:11.6F}, {:11.6F} - Spec.heat @ const.P\n");
     499             :     static constexpr std::string_view Format_1134("        wght   = {:11.6F}                           - Molecular weight\n");
     500             :     static constexpr std::string_view Format_1111(" Gap {:2}:\n");
     501             :     static constexpr std::string_view Format_1112(" Gap width: {:11.8F}\n");
     502             :     static constexpr std::string_view Format_11110(" Outdoor space:\n");
     503             :     static constexpr std::string_view Format_11111(" Indoor space:\n");
     504             :     static constexpr std::string_view Format_1198("=====  =====  =====  =====  =====  =====  =====  =====  =====  =====  =====\n");
     505             : 
     506           0 :     print(InArgumentsFile, "\n");
     507           0 :     print(InArgumentsFile, Format_1014);
     508           0 :     print(InArgumentsFile, "\n");
     509           0 :     print(InArgumentsFile, Format_1055, esky);
     510           0 :     print(InArgumentsFile, Format_1016, trmout, trmout - DataGlobalConstants::KelvinConv);
     511           0 :     print(InArgumentsFile, Format_1020, trmin, trmin - DataGlobalConstants::KelvinConv);
     512           0 :     print(InArgumentsFile, Format_1019, ebsky);
     513           0 :     print(InArgumentsFile, Format_10191, ebroom);
     514           0 :     print(InArgumentsFile, Format_1017, Gout);
     515           0 :     print(InArgumentsFile, Format_1018, Gin);
     516           0 :     print(InArgumentsFile, "\n");
     517             : 
     518           0 :     for (i = 1; i <= nlayer; ++i) {
     519           0 :         if ((TARCOGLayerType)LayerType(i) == TARCOGLayerType::VENETBLIND_HORIZ ||
     520           0 :             (TARCOGLayerType)LayerType(i) == TARCOGLayerType::VENETBLIND_VERT) { // SD layer
     521           0 :             print(InArgumentsFile, Format_1084, i, LayerType(i));
     522           0 :             print(InArgumentsFile, Format_1090, thick(i));
     523           0 :             print(InArgumentsFile, Format_1091, scon(i));
     524             :         }
     525             :     }
     526           0 :     print(InArgumentsFile, "\n");
     527             : 
     528           0 :     print(InArgumentsFile, Format_1013);
     529           0 :     for (i = 1; i <= nlayer + 1; ++i) { // loop through gaps:
     530           0 :         if ((i > 1) && (i <= nlayer)) print(InArgumentsFile, Format_1111, i - 1);
     531           0 :         if ((i > 1) && (i <= nlayer)) print(InArgumentsFile, Format_1112, gap(i - 1));
     532           0 :         if (i == 1) print(InArgumentsFile, Format_11110);
     533           0 :         if (i == nlayer + 1) print(InArgumentsFile, Format_11111);
     534           0 :         for (j = 1; j <= nmix(i); ++j) {
     535           0 :             print(InArgumentsFile, Format_1130, j, 100 * frct(j, i));
     536           0 :             print(InArgumentsFile, Format_1131, xgcon(1, j), xgcon(2, j), xgcon(3, j));
     537           0 :             print(InArgumentsFile, Format_1132, xgvis(1, j), xgvis(2, j), xgvis(3, j));
     538           0 :             print(InArgumentsFile, Format_1133, xgcp(1, j), xgcp(2, j), xgcp(3, j));
     539           0 :             print(InArgumentsFile, Format_1134, xwght(j));
     540             :         } // j - gas mix
     541             :     }     // i - gaps
     542           0 :     print(InArgumentsFile, "\n");
     543           0 :     print(InArgumentsFile, Format_1198);
     544           0 : }
     545             : 
     546           0 : void WriteOutputArguments(InputOutputFile &OutArgumentsFile,
     547             :                           [[maybe_unused]] fs::path const &DBGD,
     548             :                           int const nlayer,
     549             :                           Real64 const tamb,
     550             :                           const Array1D<Real64> &q,
     551             :                           const Array1D<Real64> &qv,
     552             :                           const Array1D<Real64> &qcgas,
     553             :                           const Array1D<Real64> &qrgas,
     554             :                           const Array1D<Real64> &theta,
     555             :                           const Array1D<Real64> &vfreevent,
     556             :                           const Array1D<Real64> &vvent,
     557             :                           const Array1D<Real64> &Keff,
     558             :                           const Array1D<Real64> &ShadeGapKeffConv,
     559             :                           Real64 const troom,
     560             :                           Real64 const ufactor,
     561             :                           Real64 const shgc,
     562             :                           Real64 const sc,
     563             :                           Real64 const hflux,
     564             :                           Real64 const shgct,
     565             :                           Real64 const hcin,
     566             :                           Real64 const hrin,
     567             :                           Real64 const hcout,
     568             :                           Real64 const hrout,
     569             :                           const Array1D<Real64> &Ra,
     570             :                           const Array1D<Real64> &Nu,
     571             :                           const Array1D<TARCOGParams::TARCOGLayerType> &LayerType,
     572             :                           const Array1D<Real64> &Ebf,
     573             :                           const Array1D<Real64> &Ebb,
     574             :                           const Array1D<Real64> &Rf,
     575             :                           const Array1D<Real64> &Rb,
     576             :                           Real64 const ebsky,
     577             :                           Real64 const Gout,
     578             :                           Real64 const ebroom,
     579             :                           Real64 const Gin,
     580             :                           Real64 const ShadeEmisRatioIn,
     581             :                           Real64 const ShadeEmisRatioOut,
     582             :                           Real64 const ShadeHcRatioIn,
     583             :                           Real64 const ShadeHcRatioOut,
     584             :                           Real64 const HcUnshadedIn,
     585             :                           Real64 const HcUnshadedOut,
     586             :                           const Array1D<Real64> &hcgas,
     587             :                           const Array1D<Real64> &hrgas,
     588             :                           Real64 const AchievedErrorTolerance,
     589             :                           int const NumOfIter)
     590             : {
     591             : 
     592             :     // Using/Aliasing
     593             :     // Argument array dimensioning
     594           0 :     EP_SIZE_CHECK(q, maxlay3);
     595           0 :     EP_SIZE_CHECK(qv, maxlay1);
     596           0 :     EP_SIZE_CHECK(qcgas, maxlay1);
     597           0 :     EP_SIZE_CHECK(qrgas, maxlay1);
     598           0 :     EP_SIZE_CHECK(theta, maxlay2);
     599           0 :     EP_SIZE_CHECK(vfreevent, maxlay1);
     600           0 :     EP_SIZE_CHECK(vvent, maxlay1);
     601           0 :     EP_SIZE_CHECK(Keff, maxlay);
     602           0 :     EP_SIZE_CHECK(ShadeGapKeffConv, MaxGap);
     603           0 :     EP_SIZE_CHECK(Ra, maxlay);
     604           0 :     EP_SIZE_CHECK(Nu, maxlay);
     605           0 :     EP_SIZE_CHECK(LayerType, maxlay);
     606           0 :     EP_SIZE_CHECK(Ebf, maxlay);
     607           0 :     EP_SIZE_CHECK(Ebb, maxlay);
     608           0 :     EP_SIZE_CHECK(Rf, maxlay);
     609           0 :     EP_SIZE_CHECK(Rb, maxlay);
     610           0 :     EP_SIZE_CHECK(hcgas, maxlay);
     611           0 :     EP_SIZE_CHECK(hrgas, maxlay);
     612             : 
     613             :     // Locals
     614           0 :     Array1D_int DATE_TIME(8);
     615           0 :     Array1D_string real_CLOCK(3);
     616             : 
     617             :     int i;
     618             : 
     619             :     // Formats
     620             :     static constexpr std::string_view Format_2000("TARCOG calculation results - {:4}-{:02}-{:02}, {:02}:{:02}:{:02}\n");
     621             :     static constexpr std::string_view Format_2120("  Ufactor  = {:12.6F}\n");
     622             :     static constexpr std::string_view Format_2130("  SHGC     = {:12.6F}\n");
     623             :     static constexpr std::string_view Format_2131("  SHGC_OLD = {:12.6F}\n");
     624             :     static constexpr std::string_view Format_2132("  SC       = {:12.6F}\n");
     625             :     static constexpr std::string_view Format_2140("  hcin  = {:10.6F}   hrin  = {:10.6F}   hin  = {:10.6F}\n");
     626             :     static constexpr std::string_view Format_2150("  hcout = {:10.6F}   hrout = {:10.6F}   hout = {:10.6F}\n");
     627             :     static constexpr std::string_view Format_2155("  Ra({:1}) ={:15.6F}        Nu({:1}) ={:12.6F}\n");
     628             :     static constexpr std::string_view Format_2160("  hcgas({:1}) ={:15.6F}      hrgas({:1}) ={:24.6F}\n");
     629             :     static constexpr std::string_view Format_2170("  hflux    = {:12.6F}\n");
     630             :     static constexpr std::string_view Format_2105("                                            Tamb ={:11.6F} K ( {:7.3F} deg C)\n");
     631             :     static constexpr std::string_view Format_2110("  ----------------- ------------------   Theta{:2} ={:11.6F} K ( {:7.3F} deg C)\n");
     632             :     static constexpr std::string_view Format_2111(
     633             :         "  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ "
     634             :         "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\   Theta{:2} ={:11.6F} K ( {:7.3F} "
     635             :         "deg C)\n");
     636             :     static constexpr std::string_view Format_2112("  +++++++++++++++++ ++++++++++++++++++   Theta{:2} ={:11.6F} K ( {:7.3F} deg C)\n");
     637             :     static constexpr std::string_view Format_2115("                                           Troom ={:11.6F} K ( {:7.3F} deg C)\n");
     638             :     static constexpr std::string_view Format_2180("           qout ={:12.5F}\n");
     639             :     static constexpr std::string_view Format_2190("  |     qpane{:2} ={:12.5F}        |\n");
     640             :     static constexpr std::string_view Format_2195("  |     qpane{:2} ={:12.5F}        |         keffc{:2} ={:11.6F}\n");
     641             :     static constexpr std::string_view Format_2199("  |      qlayer{:2} ={:12.5F}       |\n");
     642             :     static constexpr std::string_view Format_2210("            qin ={:11.6F}\n");
     643             :     static constexpr std::string_view Format_2300("            q{:2} ={:12.5F}\n");
     644             :     static constexpr std::string_view Format_2320("           qv{:2} ={:12.5F}\n");
     645             :     static constexpr std::string_view Format_2321("       airspd{:2} ={:12.5F}    keff{:2} ={:12.5F}\n");
     646             :     static constexpr std::string_view Format_2322("           qc{:2} ={:12.5F}      qr{:2} ={:12.5F}\n");
     647             :     static constexpr std::string_view Format_2330("  ShadeEmisRatioIn  ={:11.6F}        ShadeEmisRatioOut ={:11.6F}\n");
     648             :     static constexpr std::string_view Format_2331("  ShadeHcRatioIn    ={:11.6F}        ShadeHcRatioOut   ={:11.6F}\n");
     649             :     static constexpr std::string_view Format_2332("  HcUnshadedIn      ={:11.6F}        HcUnshadedOut     ={:11.6F}\n");
     650             :     static constexpr std::string_view Format_2350("Heat Flux Flow and Temperatures of Layer Surfaces:\n");
     651             :     static constexpr std::string_view Format_2351("Basic IGU properties:\n");
     652             :     static constexpr std::string_view Format_4205("  Ebsky ={:11.6F} [W/m2], Gout ={:11.6F} [W/m2]\n");
     653             :     static constexpr std::string_view Format_4215("  Ebroom ={:11.6F} [W/m2], Gin  ={:11.6F} [W/m2]\n");
     654             :     static constexpr std::string_view Format_4110("  Ef{:2} ={:11.6F} [W/m2], Rf{:2} ={:11.6F} [W/m2]\n");
     655             :     static constexpr std::string_view Format_4111("  ----------------- ------------------\n");
     656             :     static constexpr std::string_view Format_4112("  Ef{:2} ={:11.6F} [W/m2], Rf{:2} ={:11.6F} [W/m2]\n");
     657             :     static constexpr std::string_view Format_4113("  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ "
     658             :                                                   "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n");
     659             :     static constexpr std::string_view Format_4114("  Ef{:2} ={:11.6F} [W/m2], Rf{:2} ={:11.6F} [W/m2]\n");
     660             :     static constexpr std::string_view Format_4115("  +++++++++++++++++ ++++++++++++++++++\n");
     661             :     static constexpr std::string_view Format_4116("  Ef{:2} ={:11.6F} [W/m2], Rf{:2} ={:11.6F} [W/m2]\n");
     662             :     static constexpr std::string_view Format_4117("  ooooooooooooooooo oooooooooooooooooo\n");
     663             :     static constexpr std::string_view Format_4120("  Eb{:2} ={:11.6F} [W/m2], Rb{:2} ={:11.6F} [W/m2]\n");
     664             :     static constexpr std::string_view Format_4121("  ----------------- ------------------\n");
     665             :     static constexpr std::string_view Format_4122("  Eb{:2} ={:11.6F} [W/m2], Rb{:2} ={:11.6F} [W/m2]\n");
     666             :     static constexpr std::string_view Format_4123("  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ "
     667             :                                                   "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n");
     668             :     static constexpr std::string_view Format_4124("  Eb{:2} ={:11.6F} [W/m2], Rb{:2} ={:11.6F} [W/m2]\n");
     669             :     static constexpr std::string_view Format_4125("  +++++++++++++++++ ++++++++++++++++++\n");
     670             :     static constexpr std::string_view Format_4126("  Eb{:2} ={:11.6F} [W/m2], Rb{:2} ={:11.6F} [W/m2]\n");
     671             :     static constexpr std::string_view Format_4127("  ooooooooooooooooo oooooooooooooooooo\n");
     672             :     static constexpr std::string_view Format_4190("  |                     |\n");
     673             :     static constexpr std::string_view Format_4350("Energy balances on Layer Surfaces:\n");
     674             : 
     675           0 :     date_and_time(real_CLOCK(1), real_CLOCK(2), real_CLOCK(3), DATE_TIME);
     676           0 :     print(OutArgumentsFile, "\n");
     677           0 :     print(OutArgumentsFile, Format_2000, DATE_TIME(1), DATE_TIME(2), DATE_TIME(3), DATE_TIME(5), DATE_TIME(6), DATE_TIME(7));
     678           0 :     print(OutArgumentsFile, "\n");
     679           0 :     print(OutArgumentsFile, Format_2350);
     680           0 :     print(OutArgumentsFile, "\n");
     681           0 :     print(OutArgumentsFile, Format_2105, tamb, tamb - DataGlobalConstants::KelvinConv);
     682           0 :     print(OutArgumentsFile, Format_2180, q(1));
     683             : 
     684             :     // bi  Write out layer properties:
     685           0 :     for (i = 1; i <= nlayer; ++i) {
     686           0 :         switch (LayerType(i)) {
     687           0 :         case TARCOGLayerType::SPECULAR: { // Specular layer
     688           0 :             print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - DataGlobalConstants::KelvinConv);
     689           0 :             print(OutArgumentsFile, Format_2190, i, q(2 * i));
     690           0 :             print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - DataGlobalConstants::KelvinConv);
     691           0 :         } break;
     692           0 :         case TARCOGLayerType::VENETBLIND_HORIZ:
     693             :         case TARCOGLayerType::VENETBLIND_VERT: { // Venetian blind
     694           0 :             print(OutArgumentsFile, Format_2111, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - DataGlobalConstants::KelvinConv);
     695           0 :             print(OutArgumentsFile, Format_2195, i, q(2 * i), i, ShadeGapKeffConv(i));
     696           0 :             print(OutArgumentsFile, Format_2111, 2 * i, theta(2 * i), theta(2 * i) - DataGlobalConstants::KelvinConv);
     697           0 :         } break;
     698           0 :         case TARCOGLayerType::WOVSHADE: { // Venetian blind
     699           0 :             print(OutArgumentsFile, Format_2112, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - DataGlobalConstants::KelvinConv);
     700           0 :             print(OutArgumentsFile, Format_2195, i, q(2 * i), i, ShadeGapKeffConv(i));
     701           0 :             print(OutArgumentsFile, Format_2112, 2 * i, theta(2 * i), theta(2 * i) - DataGlobalConstants::KelvinConv);
     702           0 :         } break;
     703           0 :         case TARCOGLayerType::DIFFSHADE: { // Venetian blind
     704           0 :             print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - DataGlobalConstants::KelvinConv);
     705           0 :             print(OutArgumentsFile, Format_2190, i, q(2 * i));
     706           0 :             print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - DataGlobalConstants::KelvinConv);
     707           0 :         } break;
     708           0 :         default: {
     709           0 :             print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - DataGlobalConstants::KelvinConv);
     710           0 :             print(OutArgumentsFile, Format_2199, i, q(2 * i));
     711           0 :             print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - DataGlobalConstants::KelvinConv);
     712           0 :         } break;
     713             :         }
     714             : 
     715             :         // bi  Write out gap properties:
     716           0 :         if (i != nlayer) {
     717           0 :             print(OutArgumentsFile, Format_2300, i, q(2 * i + 1));
     718           0 :             print(OutArgumentsFile, Format_2320, i, qv(i + 1));
     719           0 :             if (vvent(i + 1) == 0) {
     720           0 :                 print(OutArgumentsFile, Format_2321, i, vfreevent(i + 1), i, Keff(i));
     721             :             } else {
     722           0 :                 if (i > 1) {
     723           0 :                     print(OutArgumentsFile, Format_2321, i, vvent(i + 1), i, Keff(i - 1));
     724             :                     // Autodesk:BoundsViolation Keff(i-1) @ i=1: Fixed in 8.2 by surrounding if block
     725             :                 }
     726             :             }
     727           0 :             print(OutArgumentsFile, Format_2322, i, qcgas(i + 1), i, qrgas(i + 1));
     728             :         } else {
     729           0 :             print(OutArgumentsFile, Format_2210, q(2 * i + 1));
     730             :         }
     731             :     } // i - layers
     732             : 
     733           0 :     print(OutArgumentsFile, Format_2115, troom, troom - DataGlobalConstants::KelvinConv);
     734             : 
     735           0 :     print(OutArgumentsFile, "\n");
     736             : 
     737             :     // Simon: Write energy balances on layer surfaces
     738           0 :     print(OutArgumentsFile, Format_4350);
     739           0 :     print(OutArgumentsFile, "\n");
     740           0 :     print(OutArgumentsFile, Format_4205, ebsky, Gout);
     741           0 :     print(OutArgumentsFile, "\n");
     742             : 
     743           0 :     for (i = 1; i <= nlayer; ++i) {
     744           0 :         switch (LayerType(i)) {
     745           0 :         case TARCOGLayerType::SPECULAR: { // Specular layer
     746           0 :             print(OutArgumentsFile, Format_4110, i, Ebf(i), i, Rf(i));
     747           0 :             print(OutArgumentsFile, Format_4111);
     748           0 :             print(OutArgumentsFile, Format_4190);
     749           0 :             print(OutArgumentsFile, Format_4121);
     750           0 :             print(OutArgumentsFile, Format_4120, i, Ebb(i), i, Rb(i));
     751           0 :         } break;
     752           0 :         case TARCOGLayerType::VENETBLIND_HORIZ:
     753             :         case TARCOGLayerType::VENETBLIND_VERT: { // Venetian blind
     754           0 :             print(OutArgumentsFile, Format_4112, i, Ebf(i), i, Rf(i));
     755           0 :             print(OutArgumentsFile, Format_4113);
     756           0 :             print(OutArgumentsFile, Format_4190);
     757           0 :             print(OutArgumentsFile, Format_4123);
     758           0 :             print(OutArgumentsFile, Format_4122, i, Ebb(i), i, Rb(i));
     759           0 :         } break;
     760           0 :         case TARCOGLayerType::WOVSHADE: { // Venetian blind
     761           0 :             print(OutArgumentsFile, Format_4114, i, Ebf(i), i, Rf(i));
     762           0 :             print(OutArgumentsFile, Format_4115);
     763           0 :             print(OutArgumentsFile, Format_4190);
     764           0 :             print(OutArgumentsFile, Format_4125);
     765           0 :             print(OutArgumentsFile, Format_4124, i, Ebb(i), i, Rb(i));
     766           0 :         } break;
     767           0 :         case TARCOGLayerType::DIFFSHADE: {
     768           0 :             print(OutArgumentsFile, Format_4116, i, Ebf(i), i, Rf(i));
     769           0 :             print(OutArgumentsFile, Format_4117);
     770           0 :             print(OutArgumentsFile, Format_4190);
     771           0 :             print(OutArgumentsFile, Format_4127);
     772           0 :             print(OutArgumentsFile, Format_4126, i, Ebb(i), i, Rb(i));
     773           0 :         } break;
     774           0 :         default: {
     775           0 :             print(OutArgumentsFile, Format_4110, i, Ebf(i), i, Rf(i));
     776           0 :             print(OutArgumentsFile, Format_4111);
     777           0 :             print(OutArgumentsFile, Format_4190);
     778           0 :             print(OutArgumentsFile, Format_4121);
     779           0 :             print(OutArgumentsFile, Format_4120, i, Ebb(i), i, Rb(i));
     780           0 :         } break;
     781             :         }
     782           0 :         print(OutArgumentsFile, "\n");
     783             :     }
     784             : 
     785           0 :     print(OutArgumentsFile, Format_4215, ebroom, Gin);
     786             : 
     787           0 :     print(OutArgumentsFile, "\n");
     788           0 :     print(OutArgumentsFile, Format_2351);
     789           0 :     print(OutArgumentsFile, "\n");
     790           0 :     print(OutArgumentsFile, Format_2120, ufactor);
     791           0 :     print(OutArgumentsFile, Format_2130, shgc);
     792           0 :     print(OutArgumentsFile, "\n");
     793           0 :     print(OutArgumentsFile, Format_2132, sc);
     794           0 :     print(OutArgumentsFile, Format_2170, hflux);
     795           0 :     print(OutArgumentsFile, "\n");
     796           0 :     print(OutArgumentsFile, Format_2131, shgct);
     797           0 :     print(OutArgumentsFile, "\n");
     798           0 :     print(OutArgumentsFile, Format_2140, hcin, hrin, hcin + hrin);
     799           0 :     print(OutArgumentsFile, Format_2150, hcout, hrout, hcout + hrout);
     800             : 
     801           0 :     print(OutArgumentsFile, "\n");
     802           0 :     for (i = 1; i <= nlayer - 1; ++i) {
     803           0 :         print(OutArgumentsFile, Format_2155, i, Ra(i), i, Nu(i));
     804             :     }
     805           0 :     print(OutArgumentsFile, "\n");
     806           0 :     print(OutArgumentsFile, Format_2330, ShadeEmisRatioIn, ShadeEmisRatioOut);
     807           0 :     print(OutArgumentsFile, Format_2331, ShadeHcRatioIn, ShadeHcRatioOut);
     808           0 :     print(OutArgumentsFile, Format_2332, HcUnshadedIn, HcUnshadedOut);
     809             : 
     810           0 :     print(OutArgumentsFile, "\n");
     811           0 :     for (i = 2; i <= nlayer; ++i) {
     812           0 :         print(OutArgumentsFile, Format_2160, i, hcgas(i), i, hrgas(i));
     813             :     }
     814             : 
     815           0 :     print(OutArgumentsFile, "\n");
     816           0 :     print(OutArgumentsFile, "  Error Tolerance = {:12.6E}\n", AchievedErrorTolerance);
     817             : 
     818           0 :     print(OutArgumentsFile, "\n");
     819           0 :     print(OutArgumentsFile, "  Number of Iterations = {}\n", NumOfIter);
     820           0 : }
     821             : 
     822           0 : void WriteOutputEN673(InputOutputFile &OutArgumentsFile,
     823             :                       [[maybe_unused]] fs::path const &DBGD,
     824             :                       int const nlayer,
     825             :                       Real64 const ufactor,
     826             :                       Real64 const hout,
     827             :                       Real64 const hin,
     828             :                       const Array1D<Real64> &Ra,
     829             :                       const Array1D<Real64> &Nu,
     830             :                       const Array1D<Real64> &hg,
     831             :                       const Array1D<Real64> &hr,
     832             :                       const Array1D<Real64> &hs,
     833             :                       [[maybe_unused]] int &nperr)
     834             : {
     835             : 
     836             :     // Argument array dimensioning
     837           0 :     EP_SIZE_CHECK(Ra, maxlay);
     838           0 :     EP_SIZE_CHECK(Nu, maxlay);
     839           0 :     EP_SIZE_CHECK(hg, maxlay);
     840           0 :     EP_SIZE_CHECK(hr, maxlay);
     841           0 :     EP_SIZE_CHECK(hs, maxlay);
     842             : 
     843           0 :     Array1D_int DATE_TIME(8);
     844           0 :     Array1D_string real_CLOCK(3);
     845             : 
     846             :     int i;
     847             : 
     848             :     // Formats
     849             :     static constexpr std::string_view Format_2000("TARCOG calculation results - {:4}-{:02}-{:02}, {:02}:{:02}:{:02}\n");
     850             :     static constexpr std::string_view Format_2351("Basic IGU properties:\n");
     851             :     static constexpr std::string_view Format_2120("  Ufactor  = {:12.6F}\n");
     852             :     static constexpr std::string_view Format_2220("  he = {:8.4F},   hi = {:8.4F}\n");
     853             :     static constexpr std::string_view Format_2155("  Ra({:1}) ={:15.6F}        Nu({:1}) ={:12.6F}\n");
     854             :     static constexpr std::string_view Format_2230("  hg{:2} ={:15.6E}      hr{:2} ={:15.6E}      hs{:2} ={:15.6E}\n");
     855             : 
     856           0 :     date_and_time(real_CLOCK(1), real_CLOCK(2), real_CLOCK(3), DATE_TIME);
     857           0 :     print(OutArgumentsFile, "\n");
     858           0 :     print(OutArgumentsFile, Format_2000, DATE_TIME(1), DATE_TIME(2), DATE_TIME(3), DATE_TIME(5), DATE_TIME(6), DATE_TIME(7));
     859           0 :     print(OutArgumentsFile, "\n");
     860             : 
     861           0 :     print(OutArgumentsFile, "\n");
     862           0 :     print(OutArgumentsFile, Format_2351);
     863           0 :     print(OutArgumentsFile, "\n");
     864           0 :     print(OutArgumentsFile, Format_2120, ufactor);
     865           0 :     print(OutArgumentsFile, "\n");
     866           0 :     print(OutArgumentsFile, Format_2220, hout, hin);
     867           0 :     print(OutArgumentsFile, "\n");
     868           0 :     for (i = 1; i <= nlayer - 1; ++i) {
     869           0 :         print(OutArgumentsFile, Format_2155, i, Ra(i), i, Nu(i));
     870             :     }
     871           0 :     print(OutArgumentsFile, "\n");
     872           0 :     for (i = 1; i <= nlayer - 1; ++i) {
     873           0 :         print(OutArgumentsFile, Format_2230, i, hg(i), i, hr(i), i, hs(i));
     874             :     }
     875           0 : }
     876             : 
     877           0 : void WriteTARCOGInputFile(EnergyPlusData &state,
     878             :                           Files &files,
     879             :                           std::string const &VerNum,
     880             :                           Real64 const tout,
     881             :                           Real64 const tind,
     882             :                           Real64 const trmin,
     883             :                           Real64 const wso,
     884             :                           int const iwd,
     885             :                           Real64 const wsi,
     886             :                           Real64 const dir,
     887             :                           Real64 const outir,
     888             :                           int const isky,
     889             :                           Real64 const tsky,
     890             :                           Real64 const esky,
     891             :                           Real64 const fclr,
     892             :                           Real64 const VacuumPressure,
     893             :                           Real64 const VacuumMaxGapThickness,
     894             :                           DeflectionCalculation const CalcDeflection,
     895             :                           Real64 const Pa,
     896             :                           Real64 const Pini,
     897             :                           Real64 const Tini,
     898             :                           const Array1D_int &ibc,
     899             :                           Real64 const hout,
     900             :                           Real64 const hin,
     901             :                           TARCOGGassesParams::Stdrd const standard,
     902             :                           TARCOGThermalModel const ThermalMod,
     903             :                           Real64 const SDScalar,
     904             :                           Real64 const height,
     905             :                           Real64 const heightt,
     906             :                           Real64 const width,
     907             :                           Real64 const tilt,
     908             :                           Real64 const totsol,
     909             :                           int const nlayer,
     910             :                           const Array1D<TARCOGParams::TARCOGLayerType> &LayerType,
     911             :                           const Array1D<Real64> &thick,
     912             :                           const Array1D<Real64> &scon,
     913             :                           const Array1D<Real64> &YoungsMod,
     914             :                           const Array1D<Real64> &PoissonsRat,
     915             :                           const Array1D<Real64> &asol,
     916             :                           const Array1D<Real64> &tir,
     917             :                           const Array1D<Real64> &emis,
     918             :                           const Array1D<Real64> &Atop,
     919             :                           const Array1D<Real64> &Abot,
     920             :                           const Array1D<Real64> &Al,
     921             :                           const Array1D<Real64> &Ar,
     922             :                           const Array1D<Real64> &Ah,
     923             :                           const Array1D_int &SupportPillar,     // Shows whether or not gap have support pillar
     924             :                           const Array1D<Real64> &PillarSpacing, // Pillar spacing for each gap (used in case there is support pillar)
     925             :                           const Array1D<Real64> &PillarRadius,  // Pillar radius for each gap (used in case there is support pillar)
     926             :                           const Array1D<Real64> &SlatThick,
     927             :                           const Array1D<Real64> &SlatWidth,
     928             :                           const Array1D<Real64> &SlatAngle,
     929             :                           const Array1D<Real64> &SlatCond,
     930             :                           const Array1D<Real64> &SlatSpacing,
     931             :                           const Array1D<Real64> &SlatCurve,
     932             :                           const Array1D_int &nslice,
     933             :                           const Array1D<Real64> &gap,
     934             :                           const Array1D<Real64> &GapDef,
     935             :                           const Array1D<Real64> &vvent,
     936             :                           const Array1D<Real64> &tvent,
     937             :                           const Array1D<Real64> &presure,
     938             :                           const Array1D_int &nmix,
     939             :                           Array2A_int const iprop,
     940             :                           Array2A<Real64> const frct,
     941             :                           Array2A<Real64> const xgcon,
     942             :                           Array2A<Real64> const xgvis,
     943             :                           Array2A<Real64> const xgcp,
     944             :                           const Array1D<Real64> &xwght,
     945             :                           const Array1D<Real64> &gama)
     946             : {
     947             : 
     948             :     // Using/Aliasing
     949             :     using namespace TARCOGGassesParams;
     950             : 
     951             :     // Argument array dimensioning
     952           0 :     EP_SIZE_CHECK(ibc, 2);
     953           0 :     EP_SIZE_CHECK(LayerType, maxlay);
     954           0 :     EP_SIZE_CHECK(thick, maxlay);
     955           0 :     EP_SIZE_CHECK(scon, maxlay);
     956           0 :     EP_SIZE_CHECK(YoungsMod, maxlay);
     957           0 :     EP_SIZE_CHECK(PoissonsRat, maxlay);
     958           0 :     EP_SIZE_CHECK(asol, maxlay);
     959           0 :     EP_SIZE_CHECK(tir, maxlay2);
     960           0 :     EP_SIZE_CHECK(emis, maxlay2);
     961           0 :     EP_SIZE_CHECK(Atop, maxlay);
     962           0 :     EP_SIZE_CHECK(Abot, maxlay);
     963           0 :     EP_SIZE_CHECK(Al, maxlay);
     964           0 :     EP_SIZE_CHECK(Ar, maxlay);
     965           0 :     EP_SIZE_CHECK(Ah, maxlay);
     966           0 :     EP_SIZE_CHECK(SupportPillar, maxlay);
     967           0 :     EP_SIZE_CHECK(PillarSpacing, maxlay);
     968           0 :     EP_SIZE_CHECK(PillarRadius, maxlay);
     969           0 :     EP_SIZE_CHECK(SlatThick, maxlay);
     970           0 :     EP_SIZE_CHECK(SlatWidth, maxlay);
     971           0 :     EP_SIZE_CHECK(SlatAngle, maxlay);
     972           0 :     EP_SIZE_CHECK(SlatCond, maxlay);
     973           0 :     EP_SIZE_CHECK(SlatSpacing, maxlay);
     974           0 :     EP_SIZE_CHECK(SlatCurve, maxlay);
     975           0 :     EP_SIZE_CHECK(nslice, maxlay);
     976           0 :     EP_SIZE_CHECK(gap, maxlay);
     977           0 :     EP_SIZE_CHECK(GapDef, MaxGap);
     978           0 :     EP_SIZE_CHECK(vvent, maxlay1);
     979           0 :     EP_SIZE_CHECK(tvent, maxlay1);
     980           0 :     EP_SIZE_CHECK(presure, maxlay1);
     981           0 :     EP_SIZE_CHECK(nmix, maxlay1);
     982           0 :     iprop.dim(maxgas, maxlay1);
     983           0 :     frct.dim(maxgas, maxlay1);
     984           0 :     xgcon.dim(3, maxgas);
     985           0 :     xgvis.dim(3, maxgas);
     986           0 :     xgcp.dim(3, maxgas);
     987           0 :     EP_SIZE_CHECK(xwght, maxgas);
     988           0 :     EP_SIZE_CHECK(gama, maxgas);
     989             : 
     990             :     int i;
     991             :     int j;
     992             :     int NumOfProvGasses;
     993             : 
     994           0 :     Array1D_int DATE_TIME(8);
     995           0 :     Array1D_string real_CLOCK(3);
     996             : 
     997             :     // Formats
     998             :     static constexpr std::string_view Format_111("*\n");
     999             :     static constexpr std::string_view Format_112("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
    1000             :     static constexpr std::string_view Format_113("*------------------------------------------------------------\n");
    1001             :     static constexpr std::string_view Format_200("* General options:\n");
    1002             :     static constexpr std::string_view Format_210(
    1003             :         "* <nlayer, debug, standard, ThermalMod, CalcDeflection, SDScalar, VacuumPressure, VacuumMaxGapThickness>\n");
    1004             :     static constexpr std::string_view Format_300("* Environmental settings:\n");
    1005             :     static constexpr std::string_view Format_310("* <tout, tind, wso, iwd, wsi, dir, outir, isky, tsky, esky, fclr, trmin, Pa, Pini, Tini>\n");
    1006             :     static constexpr std::string_view Format_400("* Overall IGU properties:\n");
    1007             :     static constexpr std::string_view Format_410("* <totsol, tilt, height, heightt, width>\n");
    1008             :     static constexpr std::string_view Format_600("* Outdoor environment:\n");
    1009             :     static constexpr std::string_view Format_610("* <ibc(1), hout, presure(1), 1, 1, 1.0, vvent(1), tvent(1)>\n");
    1010             :     static constexpr std::string_view Format_700("* IGU definition:\n");
    1011             :     static constexpr std::string_view Format_800("* Indoor environment:\n");
    1012             :     static constexpr std::string_view Format_810("* <ibc(2), hin, presure(nlayer+1), 1, 1, 1.0, vvent(nlayer+1), tvent(nlayer+1)>\n");
    1013             :     static constexpr std::string_view Format_900("* End file\n");
    1014             :     static constexpr std::string_view Format_10001("* created by TARCOG v. {}\n");
    1015             :     static constexpr std::string_view Format_1001("* TARCOG debug output for WinCOG, {:4}-{:02}-{:02}, {:02}:{:02}:{:02}\n");
    1016             :     static constexpr std::string_view Format_1002("*     WindowID:   {:8}  - Not specified\n");
    1017             :     static constexpr std::string_view Format_1003("*     WindowID:   {:8} \n");
    1018             :     static constexpr std::string_view Format_1006("*     IGUID:      {:8}  - Not specified\n");
    1019             :     static constexpr std::string_view Format_1007("*     IGUID:      {:8} \n");
    1020             :     static constexpr std::string_view Format_1008("*     Num Layers: {:8} \n");
    1021             :     static constexpr std::string_view Format_1010("    {:1}, {:1}, {:1}, {:1}, {:1}, {:24.12F}, {:24.12F}, {:24.12F}\n");
    1022             :     static constexpr std::string_view Format_1020(
    1023             :         "    {:24.12F}, {:24.12F}, {:24.12F}, {:1}, {:24.12F}, {:24.12F}, {:24.12F}, {:1}, {:24.12F}, {:24.12F}, "
    1024             :         "{:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}\n");
    1025             :     static constexpr std::string_view Format_1030("    {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}\n");
    1026             :     // static constexpr std::string_view Format_1031("    {:24.12F}, {:24.12F}, {:3}, {:24.12F}, {:3}, {:3}, {:24.12F}, {:24.12F}, {:24.12F},
    1027             :     // {:24.12F}, "
    1028             :     //                                  "{:24.12F}, {:24.12F}, {:2}, {:2}, {:2}, {:2}\n");
    1029             :     static constexpr std::string_view Format_1034("* <PillarSpacing(i), PillarRadius(i)\n");
    1030             :     static constexpr std::string_view Format_1035("    {:24.12F}, {:24.12F}\n");
    1031             :     static constexpr std::string_view Format_1040("    {:1}, {:24.12F}, {:24.12F}, {:1}, {:1}, {:24.12F}, {:24.12F}, {:24.12F}\n");
    1032             :     static constexpr std::string_view Format_1048("* <gap(i), GapDef(i), presure(i+1), nmix(i+1), (iprop(i+1, j), j=1,nmix(i+1)), (frct(i+1, j), "
    1033             :                                                   "\n\nj=1,nmix(i+1)), vvent(i), tvent(i), SupportPillar(i)>\n");
    1034             :     static constexpr std::string_view Format_1049("* Gap {:1}:\n");
    1035             :     static constexpr std::string_view Format_1050(
    1036             :         "* <scon(i), asol(i), thick(i), emis(2*i-1), emis(2*i), tir(2*i-1), YoungsMod(i),\n\n PoissonsRat(i), LayerType(i), nslice(i)>\n");
    1037             :     static constexpr std::string_view Format_1051(
    1038             :         "    {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:1}, {:1}\n");
    1039             :     static constexpr std::string_view Format_1052("* <Atop(i), Abot(i), Al(i), Ar(i), Ah(i)>\n");
    1040             :     static constexpr std::string_view Format_1053("    {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}\n");
    1041             :     static constexpr std::string_view Format_1054("* <SlatThick(i), SlatWidth(i), SlatAngle(i), SlatCond(i), SlatSpacing(i), SlatCurve(i)>\n");
    1042             :     static constexpr std::string_view Format_1055("    {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}\n");
    1043             :     static constexpr std::string_view Format_1060("* Layer {:1} - specular-glass:\n");
    1044             :     static constexpr std::string_view Format_1061("* Layer {:1} - venetian blind:\n");
    1045             :     static constexpr std::string_view Format_1062("* Layer {:1} - woven shade:\n");
    1046             :     static constexpr std::string_view Format_1063("* Layer {:1} - diffuse shade:\n");
    1047             :     static constexpr std::string_view Format_1064("* Layer {:1} - ???:\n");
    1048             :     static constexpr std::string_view Format_2000("* Gas coefficients information\n");
    1049             :     static constexpr std::string_view Format_2010("    {:2}\n");
    1050             :     static constexpr std::string_view Format_2011("* <NumberOfGasses>\n");
    1051             :     static constexpr std::string_view Format_2020("    {:12.6E}\n");
    1052             :     static constexpr std::string_view Format_2021("* <MolecularWeight>\n");
    1053             :     static constexpr std::string_view Format_2030(", {:12.6E}");
    1054             :     static constexpr std::string_view Format_2031("* <gconA, gconB, gconC>\n");
    1055             :     static constexpr std::string_view Format_2032("* <gvisA, gvisB, gvisC>\n");
    1056             :     static constexpr std::string_view Format_2033("* <gcpA, gcpB, gcpC>\n");
    1057             :     static constexpr std::string_view Format_2034("* <Gamma>\n");
    1058             : 
    1059           0 :     date_and_time(real_CLOCK(1), real_CLOCK(2), real_CLOCK(3), DATE_TIME);
    1060             : 
    1061           0 :     print(files.WINCogFile, Format_112);
    1062           0 :     print(files.WINCogFile, Format_111);
    1063           0 :     print(files.WINCogFile, Format_1001, DATE_TIME(1), DATE_TIME(2), DATE_TIME(3), DATE_TIME(5), DATE_TIME(6), DATE_TIME(7));
    1064           0 :     print(files.WINCogFile, Format_10001, VerNum); //, VerDat
    1065           0 :     print(files.WINCogFile, Format_111);
    1066             : 
    1067           0 :     if (state.dataTARCOGOutputs->winID == -1) {
    1068           0 :         print(files.WINCogFile, Format_1002, state.dataTARCOGOutputs->winID);
    1069             :     } else {
    1070           0 :         print(files.WINCogFile, Format_1003, state.dataTARCOGOutputs->winID);
    1071             :     }
    1072           0 :     if (state.dataTARCOGOutputs->iguID == -1) {
    1073           0 :         print(files.WINCogFile, Format_1006, state.dataTARCOGOutputs->iguID);
    1074             :     } else {
    1075           0 :         print(files.WINCogFile, Format_1007, state.dataTARCOGOutputs->iguID);
    1076             :     }
    1077             : 
    1078           0 :     print(files.WINCogFile, Format_1008, nlayer);
    1079           0 :     print(files.WINCogFile, Format_111);
    1080           0 :     print(files.WINCogFile, Format_112);
    1081             : 
    1082           0 :     print(files.WINCogFile, Format_113);
    1083           0 :     print(files.WINCogFile, Format_200);
    1084           0 :     print(files.WINCogFile, Format_113);
    1085           0 :     print(files.WINCogFile, Format_210);
    1086           0 :     print(files.WINCogFile, Format_1010, nlayer, 2, standard, ThermalMod, CalcDeflection, SDScalar, VacuumPressure, VacuumMaxGapThickness);
    1087             : 
    1088           0 :     print(files.WINCogFile, Format_113);
    1089           0 :     print(files.WINCogFile, Format_300);
    1090           0 :     print(files.WINCogFile, Format_113);
    1091           0 :     print(files.WINCogFile, Format_310);
    1092           0 :     print(files.WINCogFile, Format_1020, tout, tind, wso, iwd, wsi, dir, outir, isky, tsky, esky, fclr, trmin, Pa, Pini, Tini);
    1093             : 
    1094           0 :     NumOfProvGasses = 0;
    1095           0 :     while (xwght(NumOfProvGasses + 1) != 0) {
    1096           0 :         ++NumOfProvGasses;
    1097             :     }
    1098           0 :     print(files.WINCogFile, Format_113);
    1099           0 :     print(files.WINCogFile, Format_2000);
    1100           0 :     print(files.WINCogFile, Format_113);
    1101           0 :     print(files.WINCogFile, Format_2011);
    1102           0 :     print(files.WINCogFile, Format_2010, NumOfProvGasses);
    1103           0 :     for (i = 1; i <= NumOfProvGasses; ++i) {
    1104           0 :         print(files.WINCogFile, Format_2021);
    1105           0 :         print(files.WINCogFile, Format_2020, xwght(i));
    1106           0 :         print(files.WINCogFile, Format_2031);
    1107           0 :         for (j = 2; j <= 3; ++j) {
    1108           0 :             print(files.WINCogFile, Format_2030, xgcon(j, i));
    1109             :         }
    1110           0 :         print(files.WINCogFile, "\n");
    1111           0 :         print(files.WINCogFile, Format_2032);
    1112           0 :         for (j = 2; j <= 3; ++j) {
    1113           0 :             print(files.WINCogFile, Format_2030, xgvis(j, i));
    1114             :         }
    1115           0 :         print(files.WINCogFile, "\n");
    1116           0 :         print(files.WINCogFile, Format_2033);
    1117           0 :         for (j = 2; j <= 3; ++j) {
    1118           0 :             print(files.WINCogFile, Format_2030, xgcp(j, i));
    1119             :         }
    1120           0 :         print(files.WINCogFile, "\n");
    1121           0 :         print(files.WINCogFile, Format_2034);
    1122           0 :         print(files.WINCogFile, Format_2020, gama(i));
    1123             :     } // i = 1, NumProvGasses
    1124             : 
    1125           0 :     print(files.WINCogFile, Format_113);
    1126           0 :     print(files.WINCogFile, Format_400);
    1127           0 :     print(files.WINCogFile, Format_113);
    1128           0 :     print(files.WINCogFile, Format_410);
    1129           0 :     print(files.WINCogFile, Format_1030, totsol, tilt, height, heightt, width);
    1130             : 
    1131           0 :     print(files.WINCogFile, Format_113);
    1132           0 :     print(files.WINCogFile, Format_600);
    1133           0 :     print(files.WINCogFile, Format_113);
    1134           0 :     print(files.WINCogFile, Format_610);
    1135           0 :     print(files.WINCogFile, Format_1040, ibc(1), hout, presure(1), 1, 1, 1.0, vvent(1), tvent(1));
    1136             : 
    1137           0 :     print(files.WINCogFile, Format_700);
    1138             : 
    1139           0 :     for (i = 1; i <= nlayer; ++i) {
    1140           0 :         print(files.WINCogFile, Format_113);
    1141           0 :         if (LayerType(i) == TARCOGLayerType::SPECULAR) {
    1142           0 :             print(files.WINCogFile, Format_1060, i);
    1143           0 :         } else if (LayerType(i) == TARCOGLayerType::VENETBLIND_HORIZ || LayerType(i) == TARCOGLayerType::VENETBLIND_VERT) {
    1144           0 :             print(files.WINCogFile, Format_1061, i);
    1145           0 :         } else if (LayerType(i) == TARCOGLayerType::WOVSHADE) {
    1146           0 :             print(files.WINCogFile, Format_1062, i);
    1147           0 :         } else if (LayerType(i) == TARCOGLayerType::DIFFSHADE) {
    1148           0 :             print(files.WINCogFile, Format_1063, i);
    1149             :         } else {
    1150           0 :             print(files.WINCogFile, Format_1064, i);
    1151             :         }
    1152           0 :         print(files.WINCogFile, Format_113);
    1153             : 
    1154           0 :         print(files.WINCogFile, Format_1050);
    1155           0 :         print(files.WINCogFile,
    1156             :               Format_1051,
    1157             :               scon(i),
    1158             :               asol(i),
    1159             :               thick(i),
    1160           0 :               emis(2 * i - 1),
    1161             :               emis(2 * i),
    1162           0 :               tir(2 * i - 1),
    1163             :               YoungsMod(i),
    1164             :               PoissonsRat(i),
    1165             :               LayerType(i),
    1166             :               nslice(i));
    1167             : 
    1168           0 :         if (IsShadingLayer(LayerType(i))) {
    1169           0 :             print(files.WINCogFile, Format_1052);
    1170           0 :             print(files.WINCogFile, Format_1053, Atop(i), Abot(i), Al(i), Ar(i), Ah(i));
    1171             :         }
    1172             : 
    1173           0 :         if (LayerType(i) == TARCOGLayerType::VENETBLIND_HORIZ || LayerType(i) == TARCOGLayerType::VENETBLIND_VERT) {
    1174           0 :             print(files.WINCogFile, Format_1054);
    1175           0 :             print(files.WINCogFile, Format_1055, SlatThick(i), SlatWidth(i), SlatAngle(i), SlatCond(i), SlatSpacing(i), SlatCurve(i));
    1176             :         }
    1177             : 
    1178           0 :         if (i < nlayer) {
    1179           0 :             print(files.WINCogFile, Format_113);
    1180           0 :             print(files.WINCogFile, Format_1049, i);
    1181           0 :             print(files.WINCogFile, Format_113);
    1182           0 :             print(files.WINCogFile, Format_1048);
    1183           0 :             print(files.WINCogFile, "    {:24.12F}, {:24.12F}, {:24.12F}, {:1}, ", gap(i), GapDef(i), presure(i + 1), nmix(i + 1));
    1184           0 :             for (j = 1; j <= nmix(i + 1); ++j) {
    1185           0 :                 print(files.WINCogFile, "{:1}, ", iprop(j, i + 1));
    1186             :             }
    1187           0 :             for (j = 1; j <= nmix(i + 1); ++j) {
    1188           0 :                 print(files.WINCogFile, "{:24.12F}, ", frct(j, i + 1));
    1189             :             }
    1190           0 :             print(files.WINCogFile, "    {:24.12F}, {:24.12F}, {:1}, \n", vvent(i + 1), tvent(i + 1), SupportPillar(i));
    1191           0 :             if (SupportPillar(i) == YES_SupportPillar) {
    1192           0 :                 print(files.WINCogFile, Format_1034);
    1193           0 :                 print(files.WINCogFile, Format_1035, PillarSpacing(i), PillarRadius(i));
    1194             :             }
    1195             :         }
    1196             :     } //  i - layers
    1197             : 
    1198           0 :     print(files.WINCogFile, Format_113);
    1199           0 :     print(files.WINCogFile, Format_800);
    1200           0 :     print(files.WINCogFile, Format_113);
    1201             : 
    1202           0 :     print(files.WINCogFile, Format_810);
    1203           0 :     print(files.WINCogFile, Format_1040, ibc(2), hin, presure(nlayer + 1), 1, 1, 1.0, vvent(nlayer + 1), tvent(nlayer + 1));
    1204             : 
    1205           0 :     print(files.WINCogFile, Format_113);
    1206           0 :     print(files.WINCogFile, Format_900);
    1207           0 :     print(files.WINCogFile, Format_113);
    1208           0 :     print(files.WINCogFile, "\n");
    1209           0 : }
    1210             : 
    1211       35972 : void FinishDebugOutputFiles(Files &files, int const nperr)
    1212             : {
    1213             : 
    1214             :     static constexpr std::string_view Format_2360("TARCOG status: {:3} - Normal termination.\n");
    1215             :     static constexpr std::string_view Format_2361("TARCOG status: {:3} - Warning!\n");
    1216             :     static constexpr std::string_view Format_2362("TARCOG status: {:3} - Error!\n");
    1217             :     static constexpr std::string_view Format_1199("#####  #####  #####  #####  #####  #####  #####  #####  #####  #####  #####\n");
    1218             : 
    1219       35972 :     if (files.WriteDebugOutput) {
    1220             : 
    1221           0 :         print(files.DebugOutputFile, "\n");
    1222           0 :         if ((nperr > 0) && (nperr < 1000)) {
    1223           0 :             print(files.DebugOutputFile, Format_2362, nperr);
    1224           0 :         } else if ((nperr >= 1000)) {
    1225           0 :             print(files.DebugOutputFile, Format_2361, nperr);
    1226             :         } else {
    1227           0 :             print(files.DebugOutputFile, Format_2360, nperr);
    1228             :         }
    1229             : 
    1230           0 :         print(files.DebugOutputFile, "\n");
    1231           0 :         print(files.DebugOutputFile, Format_1199);
    1232           0 :         print(files.DebugOutputFile, Format_1199);
    1233             : 
    1234             :     } // debug
    1235             : 
    1236             :     // Close debug files
    1237       35972 :     if (files.DebugOutputFile.good()) {
    1238           0 :         files.DebugOutputFile.close();
    1239             :     }
    1240             : 
    1241       35972 :     if (files.WINCogFile.good()) {
    1242           0 :         files.WINCogFile.close();
    1243             :     }
    1244             : 
    1245       35972 :     if (files.IterationCSVFile.good()) {
    1246           0 :         files.IterationCSVFile.close();
    1247             :     }
    1248             : 
    1249       35972 :     if (files.TarcogIterationsFile.good()) {
    1250           0 :         files.TarcogIterationsFile.close();
    1251             :     }
    1252       35972 : }
    1253             : 
    1254       37990 : void PrepDebugFilesAndVariables(EnergyPlusData &state,
    1255             :                                 Files &files,
    1256             :                                 fs::path const &Debug_dir,
    1257             :                                 fs::path const &Debug_file,
    1258             :                                 [[maybe_unused]] int const Debug_mode,
    1259             :                                 int const win_ID,
    1260             :                                 int const igu_ID)
    1261             : {
    1262             : 
    1263       37990 :     files.DBGD = Debug_dir;
    1264             : 
    1265       37990 :     state.dataTARCOGOutputs->winID = win_ID;
    1266       37990 :     state.dataTARCOGOutputs->iguID = igu_ID;
    1267             : 
    1268             :     // setup file names if file name is provided, otherwise keep default
    1269       37990 :     if (!Debug_file.empty()) {
    1270       37990 :         files.WINCogFilePath = fs::path(Debug_file.string() + ".w7");
    1271       37990 :         files.DebugOutputFilePath = fs::path(Debug_file.string() + ".dbg");
    1272             :     }
    1273             : 
    1274       37990 :     files.WriteDebugOutput = false;
    1275             :     // there used to be a block under here but the debug flag was hardwired to not do any reporting, so it was removed
    1276       37990 : }
    1277             : 
    1278        2313 : } // namespace EnergyPlus::TARCOGOutput

Generated by: LCOV version 1.13