Skip to content

Commit

Permalink
Merge pull request #8297 from NREL/meter-custom-name
Browse files Browse the repository at this point in the history
Skip Meter:Custom* Transitions
  • Loading branch information
mjwitte authored Sep 23, 2020
2 parents 1b877a1 + 9b6f1b1 commit 9fc1e48
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/EnergyPlus/InputProcessing/InputProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,6 @@ void InputProcessor::preScanReportingVariables()
// Output:Variable
// Meter:Custom
// Meter:CustomDecrement
// Meter:CustomDifference
// Output:Table:Monthly
// Output:Table:TimeBins
// Output:Table:SummaryReports
Expand All @@ -1649,7 +1648,6 @@ void InputProcessor::preScanReportingVariables()
static std::string const OutputVariable("Output:Variable");
static std::string const MeterCustom("Meter:Custom");
static std::string const MeterCustomDecrement("Meter:CustomDecrement");
// static std::string const MeterCustomDifference( "METER:CUSTOMDIFFERENCE" );
static std::string const OutputTableMonthly("Output:Table:Monthly");
static std::string const OutputTableAnnual("Output:Table:Annual");
static std::string const OutputTableTimeBins("Output:Table:TimeBins");
Expand Down
44 changes: 42 additions & 2 deletions src/Transition/CreateNewIDFUsingRulesV9_4_0.f90
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
LOGICAL :: alreadyProcessedOneOutputDiagnostic=.false.
INTEGER :: nE, nEC, nG, nNG, nFO, nFON

LOGICAL :: changeMeterNameFlag
INTEGER :: totMeterCustom = 0
INTEGER :: totMeterCustomDecr = 0
INTEGER numMeterCustom
CHARACTER(len=MaxNameLength) :: MeterCustomName
CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: MeterCustomNames

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! E N D O F I N S E R T L O C A L V A R I A B L E S H E R E !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down Expand Up @@ -242,6 +249,8 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
ALLOCATE(NwAorN(MaxTotalArgs),NwReqFld(MaxTotalArgs),NwFldNames(MaxTotalArgs),NwFldDefaults(MaxTotalArgs),NwFldUnits(MaxTotalArgs))
ALLOCATE(OutArgs(MaxTotalArgs))
ALLOCATE(DeleteThisRecord(NumIDFRecords))
ALLOCATE(MeterCustomNames(NumIDFRecords))

DeleteThisRecord=.false.

NoVersion=.true.
Expand Down Expand Up @@ -291,7 +300,29 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
ENDDO
CALL DisplayString('Processing IDF -- OutputDiagnostics preprocessing complete.')
ENDIF
! End Pre-process OutputDiagnostics
! End Pre-process OutputDiagnostics

!- Pre-process for names of Meter:Custom objects
totMeterCustom = GetNumObjectsFound('METER:CUSTOM')
IF (totMeterCustom > 0) THEN
DO numMeterCustom=1, totMeterCustom
CALL GetObjectItem('METER:CUSTOM', numMeterCustom, Alphas, NumAlphas, Numbers, NumNumbers, Status)
MeterCustomName = MakeUpperCase(TRIM(Alphas(1)))
MeterCustomNames(numMeterCustom) = MeterCustomName
END DO
END IF
!- Ene Pre-process for names of Meter:Custom objects

!- Pre-process for names of Meter:CustomDecrement objects
totMeterCustomDecr = GetNumObjectsFound('METER:CUSTOMDECREMENT')
IF (totMeterCustomDecr > 0) THEN
DO numMeterCustom=1, totMeterCustomDecr
CALL GetObjectItem('METER:CUSTOMDECREMENT', numMeterCustom, Alphas, NumAlphas, Numbers, NumNumbers, Status)
MeterCustomName = MakeUpperCase(TRIM(Alphas(1)))
MeterCustomNames(numMeterCustom + totMeterCustom) = MeterCustomName
END DO
END IF
!- Ene Pre-process for names of Meter:CustomDecrement objects

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! P R O C E S S I N G !
Expand Down Expand Up @@ -604,7 +635,16 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
.false.)
IF (DelThis) CYCLE
IF (CurArgs .GE. 1) THEN
CALL ReplaceFuelNameWithEndUseSubcategory(OutArgs(1), NoDiff)
changeMeterNameFlag = .true.
DO numMeterCustom=1, totMeterCustom + totMeterCustomDecr
MeterCustomName = MeterCustomNames(numMeterCustom)
IF (MeterCustomName .eq. MakeUPPERCase(InArgs(1))) THEN
changeMeterNameFlag = .false.
END IF
END DO
IF (changeMeterNameFlag) THEN
CALL ReplaceFuelNameWithEndUseSubcategory(OutArgs(1), NoDiff)
END IF
END IF

CASE('OUTPUT:TABLE:TIMEBINS')
Expand Down

5 comments on commit 9fc1e48

@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.

develop (mjwitte) - x86_64-MacOS-10.15-clang-11.0.0: OK (2234 of 2234 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

develop (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2254 of 2254 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.

develop (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1516 of 1516 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.

develop (mjwitte) - Win64-Windows-10-VisualStudio-16: OK (2207 of 2207 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.

develop (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (721 of 721 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.