Skip to content

Commit

Permalink
Revert "auto constexpr + warnings Pumps.cc"
Browse files Browse the repository at this point in the history
This reverts commit c950b31.
  • Loading branch information
jmythms committed Dec 3, 2020
1 parent 9480627 commit eabe692
Showing 1 changed file with 15 additions and 23 deletions.
38 changes: 15 additions & 23 deletions src/EnergyPlus/Pumps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ namespace Pumps {

// SUBROUTINE PARAMETER DEFINITIONS:
Real64 const StartTemp(100.0); // Standard Temperature across code to calculated Steam density
auto constexpr RoutineName("GetPumpInput: ");
auto constexpr RoutineNameNoColon("GetPumpInput");
static std::string const RoutineName("GetPumpInput: ");
static std::string const RoutineNameNoColon("GetPumpInput");

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int PumpNum;
Expand Down Expand Up @@ -1299,7 +1299,7 @@ namespace Pumps {
// SUBROUTINE PARAMETER DEFINITIONS:
Real64 const StartTemp(100.0); // Standard Temperature across code to calculated Steam density
Real64 const ZeroPowerTol(0.0000001);
auto constexpr RoutineName("PlantPumps::InitializePumps ");
static std::string const RoutineName("PlantPumps::InitializePumps ");

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int InletNode; // pump inlet node number
Expand Down Expand Up @@ -1572,7 +1572,7 @@ namespace Pumps {
// SUBROUTINE ARGUMENT DEFINITIONS:

// SUBROUTINE PARAMETER DEFINITIONS:
auto constexpr RoutineName("PlantPumps:SetupPumpMinMaxFlows: ");
static std::string const RoutineName("PlantPumps:SetupPumpMinMaxFlows: ");

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int InletNode; // pump inlet node number
Expand Down Expand Up @@ -1933,23 +1933,19 @@ namespace Pumps {
//****************************!
if (Power < 0.0) {
if (PumpEquip(PumpNum).PowerErrIndex1 == 0) {
ShowWarningMessage(
state,
format("{} Calculated Pump Power < 0, Type={}, Name=\"{}\".", RoutineName, cPumpTypes(PumpType), PumpEquip(PumpNum).Name));
ShowWarningMessage(state, RoutineName + " Calculated Pump Power < 0, Type=" + cPumpTypes(PumpType) + ", Name=\"" + PumpEquip(PumpNum).Name +
"\".");
ShowContinueErrorTimeStamp(state, "");
ShowContinueError(state, format("...PartLoadRatio=[{:.4R}], Fraction Full Load Power={:.4R}]", PartLoadRatio, FracFullLoadPower));
ShowContinueError(state, "...Power is set to 0 for continuing the simulation.");
ShowContinueError(state, "...Pump coefficients should be checked for producing this negative value.");
}
Power = 0.0;
ShowRecurringWarningErrorAtEnd(state,
format("{} Calculated Pump Power < 0, {}, Name=\"{}\", PLR=",
RoutineName,
cPumpTypes(PumpType),
PumpEquip(PumpNum).Name),
PumpEquip(PumpNum).PowerErrIndex1,
PartLoadRatio,
PartLoadRatio);
ShowRecurringWarningErrorAtEnd(state, RoutineName + " Calculated Pump Power < 0, " + cPumpTypes(PumpType) + ", Name=\"" +
PumpEquip(PumpNum).Name + "\", PLR=",
PumpEquip(PumpNum).PowerErrIndex1,
PartLoadRatio,
PartLoadRatio);
ShowRecurringContinueErrorAtEnd(state, "...Fraction Full Load Power=", PumpEquip(PumpNum).PowerErrIndex2, FracFullLoadPower, FracFullLoadPower);
}

Expand All @@ -1964,9 +1960,7 @@ namespace Pumps {
TotalEffic = PumpEquip(PumpNum).PumpEffic * PumpEquip(PumpNum).MotorEffic;
// Efficiency errors are caught previously, but it doesn't hurt to add another catch before dividing by zero!!!
if (TotalEffic == 0.0) {
ShowSevereError(state,
format("{} Plant pressure simulation encountered a pump with zero efficiency: {}",
RoutineName, PumpEquip(PumpNum).Name));
ShowSevereError(state, RoutineName + " Plant pressure simulation encountered a pump with zero efficiency: " + PumpEquip(PumpNum).Name);
ShowContinueError(state, "Check efficiency inputs for this pump component.");
ShowFatalError(state, "Errors in plant calculation would result in divide-by-zero cause program termination.");
}
Expand All @@ -1979,9 +1973,7 @@ namespace Pumps {
TotalEffic = PumpEquip(PumpNum).PumpEffic * PumpEquip(PumpNum).MotorEffic;
// Efficiency errors are caught previously, but it doesn't hurt to add another catch before dividing by zero!!!
if (TotalEffic == 0.0) {
/*ShowSevereError(state, RoutineName + " Plant pump simulation encountered a pump with zero efficiency: " + PumpEquip(PumpNum).Name);*/
ShowSevereError(state,
format("{} Plant pump simulation encountered a pump with zero efficiency: {}", RoutineName, PumpEquip(PumpNum).Name));
ShowSevereError(state, RoutineName + " Plant pump simulation encountered a pump with zero efficiency: " + PumpEquip(PumpNum).Name);
ShowContinueError(state, "Check efficiency inputs for this pump component.");
ShowFatalError(state, "Errors in plant calculation would result in divide-by-zero cause program termination.");
}
Expand Down Expand Up @@ -2044,8 +2036,8 @@ namespace Pumps {

// SUBROUTINE PARAMETER DEFINITIONS:
Real64 const StartTemp(100.0); // Standard Temperature across code to calculated Steam density
auto constexpr RoutineName("PlantPumps::InitSimVars ");
auto constexpr RoutineNameSizePumps("SizePumps");
static std::string const RoutineName("PlantPumps::InitSimVars ");
static std::string const RoutineNameSizePumps("SizePumps");

// INTERFACE BLOCK SPECIFICATIONS
// na
Expand Down

5 comments on commit eabe692

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jermy-const-cleanups (jmythms) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3033 of 3034 tests passed, 0 test warnings)

Messages:\n

  • 1 test had: EIO diffs.
  • 1 test had: ESO small diffs.
  • 1 test had: MTR small diffs.
  • 1 test had: Table big diffs.

Failures:\n

regression Test Summary

  • Passed: 736
  • Failed: 1

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jermy-const-cleanups (jmythms) - x86_64-MacOS-10.15-clang-11.0.0: OK (2994 of 2994 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jermy-const-cleanups (jmythms) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1558 of 1558 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jermy-const-cleanups (jmythms) - Win64-Windows-10-VisualStudio-16: OK (2250 of 2250 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jermy-const-cleanups (jmythms) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: Coverage Too Low

Build Badge Test Badge Coverage Badge

Please sign in to comment.