@@ -545,9 +545,8 @@ namespace OutputProcessor {
545
545
}
546
546
}
547
547
548
- std::string ProduceMinMaxString ([[maybe_unused]] Real64 value,
549
- int const date, // Date of min/max
550
- ReportFreq const freq // Reporting Frequency
548
+ std::string produceDateString (int const date, // Date of min/max
549
+ ReportFreq const freq // Reporting Frequency
551
550
)
552
551
{
553
552
@@ -1802,15 +1801,7 @@ namespace OutputProcessor {
1802
1801
}
1803
1802
1804
1803
if (periodTS.Rpt ) {
1805
- WriteReportMeterData (state,
1806
- periodTS.RptNum ,
1807
- periodTS.Value ,
1808
- ReportFreq::TimeStep,
1809
- -1.0 , // MinValue
1810
- -1 , // MinValueDate
1811
- -1.0 , // MaxValue
1812
- -1 , // MaxValueDate
1813
- periodTS.RptFO );
1804
+ periodTS.WriteReportData (state, ReportFreq::TimeStep);
1814
1805
rfMetersTS.pushVariableValue (periodTS.RptNum , periodTS.Value );
1815
1806
}
1816
1807
@@ -1943,16 +1934,7 @@ namespace OutputProcessor {
1943
1934
}
1944
1935
1945
1936
if (period.Rpt ) {
1946
- WriteReportMeterData (state,
1947
- period.RptNum ,
1948
- period.Value ,
1949
- freq,
1950
- (freq == ReportFreq::Hour) ? -1.0 : period.MinVal ,
1951
- (freq == ReportFreq::Hour) ? -1 : period.MinValDate ,
1952
- (freq == ReportFreq::Hour) ? -1.0 : period.MaxVal ,
1953
- (freq == ReportFreq::Hour) ? -1 : period.MaxValDate ,
1954
- period.RptFO ); // EnergyMeters(Loop)%HRMinVal, EnergyMeters(Loop)%HRMinValDate, & |
1955
- // EnergyMeters(Loop)%HRMaxVal, EnergyMeters(Loop)%HRMaxValDate, &
1937
+ period.WriteReportData (state, freq);
1956
1938
rfMeters.pushVariableValue (period.RptNum , period.Value );
1957
1939
period.Value = 0.0 ;
1958
1940
@@ -2696,23 +2678,14 @@ namespace OutputProcessor {
2696
2678
}
2697
2679
} // WriteCumulativeReportMeterData()
2698
2680
2699
- void WriteReportMeterData (EnergyPlusData &state,
2700
- int const reportID, // The variable's report ID
2701
- Real64 const repValue, // The variable's value
2702
- ReportFreq const freq, // The variable's reporting interval (e.g., hourly)
2703
- Real64 const minValue, // The variable's minimum value during the reporting interval
2704
- int const minValueDate, // The date the minimum value occurred
2705
- Real64 const maxValue, // The variable's maximum value during the reporting interval
2706
- int const maxValueDate, // The date of the maximum value
2707
- bool const meterOnlyFlag // Indicates whether the data is for the meter file only
2681
+ void MeterPeriod::WriteReportData (EnergyPlusData &state,
2682
+ ReportFreq const freq
2708
2683
)
2709
2684
{
2710
2685
2711
2686
// SUBROUTINE INFORMATION:
2712
2687
// AUTHOR Greg Stark
2713
2688
// DATE WRITTEN July 2008
2714
- // MODIFIED na
2715
- // RE-ENGINEERED na
2716
2689
2717
2690
// PURPOSE OF THIS SUBROUTINE:
2718
2691
// This subroutine writes for the non-cumulative meter data to the output files and
@@ -2722,49 +2695,49 @@ namespace OutputProcessor {
2722
2695
2723
2696
std::string NumberOut;
2724
2697
2725
- if (repValue == 0.0 ) {
2698
+ if (Value == 0.0 ) {
2726
2699
NumberOut = " 0.0" ;
2727
2700
} else {
2728
2701
char tmp[128 ];
2729
- dtoa (repValue , tmp);
2702
+ dtoa (Value , tmp);
2730
2703
NumberOut = std::string (tmp);
2731
2704
}
2732
2705
2733
2706
if (sql) {
2734
2707
sql->createSQLiteReportDataRecord (
2735
- reportID, repValue , freq, minValue, minValueDate, maxValue, maxValueDate , state.dataGlobal ->MinutesPerTimeStep );
2708
+ RptNum, Value , freq, MinVal, MinValDate, MaxVal, MaxValDate , state.dataGlobal ->MinutesPerTimeStep );
2736
2709
}
2737
2710
2738
2711
if ((freq == ReportFreq::EachCall) || (freq == ReportFreq::TimeStep) || (freq == ReportFreq::Hour)) { // -1, 0, 1
2739
2712
if (state.files .mtr .good ()) {
2740
- print (state.files .mtr , " {},{}\n " , reportID , NumberOut);
2713
+ print (state.files .mtr , " {},{}\n " , RptNum , NumberOut);
2741
2714
}
2742
2715
++state.dataGlobal ->StdMeterRecordCount ;
2743
- if (state.files .eso .good () && !meterOnlyFlag ) {
2744
- print (state.files .eso , " {},{}\n " , reportID , NumberOut);
2716
+ if (state.files .eso .good () && !RptFO ) {
2717
+ print (state.files .eso , " {},{}\n " , RptNum , NumberOut);
2745
2718
++state.dataGlobal ->StdOutputRecordCount ;
2746
2719
}
2747
2720
} else { // if ( ( reportingInterval == ReportDaily ) || ( reportingInterval == ReportMonthly ) || ( reportingInterval == ReportSim ) ) {
2748
2721
// // 2, 3, 4
2749
2722
// Append the min and max strings with date information
2750
2723
char minValString[128 ], maxValString[128 ];
2751
- dtoa (minValue , minValString);
2752
- dtoa (maxValue , maxValString);
2724
+ dtoa (MinVal , minValString);
2725
+ dtoa (MaxVal , maxValString);
2753
2726
2754
- std::string minDateString = ProduceMinMaxString (minValue, minValueDate , freq);
2755
- std::string maxDateString = ProduceMinMaxString (maxValue, maxValueDate , freq);
2727
+ std::string minDateString = produceDateString (MinValDate , freq);
2728
+ std::string maxDateString = produceDateString (MaxValDate , freq);
2756
2729
2757
2730
if (state.files .mtr .good ()) {
2758
- print (state.files .mtr , " {},{},{},{},{},{}\n " , reportID , NumberOut, minValString, minDateString, maxValString, maxDateString);
2731
+ print (state.files .mtr , " {},{},{},{},{},{}\n " , RptNum , NumberOut, minValString, minDateString, maxValString, maxDateString);
2759
2732
}
2760
2733
2761
2734
++state.dataGlobal ->StdMeterRecordCount ;
2762
- if (state.files .eso .good () && !meterOnlyFlag ) {
2763
- print (state.files .eso , " {},{},{},{},{},{}\n " , reportID , NumberOut, minValString, minDateString, maxValString, maxDateString);
2735
+ if (state.files .eso .good () && !RptFO ) {
2736
+ print (state.files .eso , " {},{},{},{},{},{}\n " , RptNum , NumberOut, minValString, minDateString, maxValString, maxDateString);
2764
2737
++state.dataGlobal ->StdOutputRecordCount ;
2765
2738
}
2766
2739
}
2767
- } // WriteReportMeterData ()
2740
+ } // MeterPeriod::WriteReportData ()
2768
2741
2769
2742
void WriteNumericData (EnergyPlusData &state,
2770
2743
int const reportID, // The variable's reporting ID
@@ -3048,8 +3021,8 @@ namespace OutputProcessor {
3048
3021
dtoa (MinValue, minValString);
3049
3022
dtoa (MaxValue, maxValString);
3050
3023
3051
- std::string minDateString = ProduceMinMaxString (MinValue, minValueDate, freq);
3052
- std::string maxDateString = ProduceMinMaxString (MaxValue, maxValueDate, freq);
3024
+ std::string minDateString = produceDateString ( minValueDate, freq);
3025
+ std::string maxDateString = produceDateString ( maxValueDate, freq);
3053
3026
3054
3027
print (state.files .eso , " {},{},{},{},{},{}\n " , ReportID, NumberOut, minValString, minDateString, maxValString, maxDateString);
3055
3028
}
@@ -3499,37 +3472,51 @@ void UpdateDataandReport(EnergyPlusData &state, OutputProcessor::TimeStepType co
3499
3472
3500
3473
// Main "Record Keeping" Loops for R and I variables
3501
3474
for (auto *var : op->outVars ) {
3502
- if (var->varType != VariableType::Real) continue ;
3475
+ #ifdef GET_OUT
3476
+ if (var->varType != VariableType::Real) continue ;
3477
+ #endif // GET_OUT
3503
3478
if (var->timeStepType != t_TimeStepTypeKey) continue ;
3504
3479
3505
- OutVarReal *rVar = dynamic_cast <OutVarReal *>(var);
3506
- assert (rVar != nullptr );
3480
+ Real64 value = (var->varType == VariableType::Real) ?
3481
+ *(dynamic_cast <OutVarReal *>(var))->Which :
3482
+ *(dynamic_cast <OutVarInt *>(var))->Which ;
3507
3483
3508
3484
var->Stored = true ;
3509
3485
3510
- if (rVar ->storeType == StoreType::Average) {
3511
- Real64 CurVal = (*rVar-> Which ) * rxTime;
3486
+ if (var ->storeType == StoreType::Average) {
3487
+ Real64 CurVal = value * rxTime;
3512
3488
// TODO: Is this correct? Integer logic is different
3513
- if ((*rVar->Which ) > var->MaxValue ) {
3514
- var->MaxValue = (*rVar->Which );
3515
- var->maxValueDate = MDHM;
3516
- }
3517
- if ((*rVar->Which ) < var->MinValue ) {
3518
- var->MinValue = (*rVar->Which );
3519
- var->minValueDate = MDHM;
3489
+ if (var->varType == VariableType::Real) {
3490
+ if (value > var->MaxValue ) {
3491
+ var->MaxValue = value;
3492
+ var->maxValueDate = MDHM;
3493
+ }
3494
+ if (value < var->MinValue ) {
3495
+ var->MinValue = value;
3496
+ var->minValueDate = MDHM;
3497
+ }
3498
+ } else { // var->varType == VariableType::Integer
3499
+ if (CurVal > var->MaxValue ) {
3500
+ var->MaxValue = CurVal;
3501
+ var->maxValueDate = MDHM;
3502
+ }
3503
+ if (CurVal < var->MinValue ) {
3504
+ var->MinValue = CurVal;
3505
+ var->minValueDate = MDHM;
3506
+ }
3520
3507
}
3521
3508
var->TSValue += CurVal;
3522
3509
var->EITSValue = var->TSValue ; // CR - 8481 fix - 09/06/2011
3523
3510
} else {
3524
- if ((*rVar-> Which ) > rVar ->MaxValue ) {
3525
- rVar ->MaxValue = (*rVar-> Which ) ;
3526
- rVar ->maxValueDate = MDHM;
3511
+ if (value > var ->MaxValue ) {
3512
+ var ->MaxValue = value ;
3513
+ var ->maxValueDate = MDHM;
3527
3514
}
3528
- if ((*rVar-> Which ) < rVar ->MinValue ) {
3529
- rVar ->MinValue = (*rVar-> Which ) ;
3530
- rVar ->minValueDate = MDHM;
3515
+ if (value < var ->MinValue ) {
3516
+ var ->MinValue = value ;
3517
+ var ->minValueDate = MDHM;
3531
3518
}
3532
- var->TSValue += (*rVar-> Which ) ;
3519
+ var->TSValue += value ;
3533
3520
var->EITSValue = var->TSValue ; // CR - 8481 fix - 09/06/2011
3534
3521
}
3535
3522
@@ -3573,14 +3560,15 @@ void UpdateDataandReport(EnergyPlusData &state, OutputProcessor::TimeStepType co
3573
3560
TimePrint = false ;
3574
3561
}
3575
3562
3576
- WriteNumericData (state, var->ReportID , *rVar-> Which );
3563
+ WriteNumericData (state, var->ReportID , value );
3577
3564
++state.dataGlobal ->StdOutputRecordCount ;
3578
3565
3579
3566
if (rf->timeSeriesEnabled ()) {
3580
- rf->detailedTSData [(int )t_TimeStepTypeKey].pushVariableValue (var->ReportID , *rVar-> Which );
3567
+ rf->detailedTSData [(int )t_TimeStepTypeKey].pushVariableValue (var->ReportID , value );
3581
3568
}
3582
3569
} // for (var)
3583
3570
3571
+ #ifdef GET_OUT
3584
3572
for (auto *var : op->outVars ) {
3585
3573
if (var->varType != VariableType::Integer) continue ;
3586
3574
if (var->timeStepType != t_TimeStepTypeKey) continue ;
@@ -3662,7 +3650,8 @@ void UpdateDataandReport(EnergyPlusData &state, OutputProcessor::TimeStepType co
3662
3650
rf->detailedTSData [(int )t_TimeStepTypeKey].pushVariableValue (iVar->ReportID , *iVar->Which );
3663
3651
}
3664
3652
} // for (var)
3665
-
3653
+ #endif // GET_OUT
3654
+
3666
3655
if (t_TimeStepTypeKey == TimeStepType::System) return ; // All other stuff happens at the "zone" time step call to this routine.
3667
3656
3668
3657
// TimeStep Block (Report on Zone TimeStep)
@@ -3908,11 +3897,6 @@ void UpdateDataandReport(EnergyPlusData &state, OutputProcessor::TimeStepType co
3908
3897
if (var->varType != VariableType::Integer) continue ;
3909
3898
if (var->timeStepType != TimeStepType::Zone && var->timeStepType != TimeStepType::System) continue ;
3910
3899
3911
- // ReportNow=.TRUE.
3912
- // IF (RVar%SchedPtr > 0) &
3913
- // ReportNow=(GetCurrentScheduleValue(state, RVar%SchedPtr) /= 0.0) !SetReportNow(RVar%SchedPtr)
3914
-
3915
- // IF (ReportNow) THEN
3916
3900
if (var->tsStored ) {
3917
3901
if (var->storeType == StoreType::Average) {
3918
3902
var->Value /= double (var->thisTSCount );
@@ -4752,7 +4736,7 @@ void GetVariableKeyCountandType(EnergyPlusData &state,
4752
4736
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
4753
4737
auto &op = state.dataOutputProcessor ;
4754
4738
4755
- varType = VariableType::NotFound ;
4739
+ varType = VariableType::Invalid ;
4756
4740
numKeys = 0 ;
4757
4741
storeType = StoreType::Average;
4758
4742
timeStepType = TimeStepType::Zone;
@@ -5055,6 +5039,7 @@ void ProduceRDDMDD(EnergyPlusData &state)
5055
5039
5056
5040
if (ddVar->ReportedOnDDFile ) continue ;
5057
5041
5042
+ static constexpr std::array<std::string_view, (int )TimeStepType::Num> timeStepNamesLocal = {" Zone" , " HVAC" };
5058
5043
std::string_view timeStepName = timeStepTypeNames[(int )ddVar->timeStepType ];
5059
5044
std::string_view storeTypeName = storeTypeNames[(int )ddVar->storeType ];
5060
5045
std::string_view varName = ddVar->name ;
0 commit comments