From 7ac550ff05dd91e575c81eecd452132182468d2b Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 22 Sep 2020 14:23:11 -0600 Subject: [PATCH 1/3] stub out for skipping meter:custom names --- .../CreateNewIDFUsingRulesV9_4_0.f90 | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/src/Transition/CreateNewIDFUsingRulesV9_4_0.f90 b/src/Transition/CreateNewIDFUsingRulesV9_4_0.f90 index e3d2a863b98..829815c83dd 100644 --- a/src/Transition/CreateNewIDFUsingRulesV9_4_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesV9_4_0.f90 @@ -128,6 +128,12 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile LOGICAL :: alreadyProcessedOneOutputDiagnostic=.false. INTEGER :: nE, nEC, nG, nNG, nFO, nFON + LOGICAL :: changeMeterNameFlag + INTEGER :: numMeterCustomNames = 0 + INTEGER numMeterCustom + CHARACTER(len=MaxNameLength) :: MeterCustomName + CHARACTER, 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 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -242,6 +248,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. @@ -291,7 +299,20 @@ 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 + numMeterCustomNames = GetNumObjectsFound('METER:CUSTOM') + IF (numMeterCustomNames > 1) THEN + DO numMeterCustom=1, numMeterCustomNames + 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 + + CALL DisplayString(MeterCustomNames(1)) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! P R O C E S S I N G ! @@ -604,7 +625,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, numMeterCustomNames + MeterCustomName = MeterCustomNames(numMeterCustom) + IF (MeterCustomName .eq. 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') From 668a1f84a24ebc6f45ccbf8eedb8a8dd67b99578 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 22 Sep 2020 16:42:47 -0600 Subject: [PATCH 2/3] skip meter:custom transtions --- .../InputProcessing/InputProcessor.cc | 2 -- .../CreateNewIDFUsingRulesV9_4_0.f90 | 27 +++++++++++++------ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/EnergyPlus/InputProcessing/InputProcessor.cc b/src/EnergyPlus/InputProcessing/InputProcessor.cc index e32a8518188..2ff29885f71 100644 --- a/src/EnergyPlus/InputProcessing/InputProcessor.cc +++ b/src/EnergyPlus/InputProcessing/InputProcessor.cc @@ -1638,7 +1638,6 @@ void InputProcessor::preScanReportingVariables() // Output:Variable // Meter:Custom // Meter:CustomDecrement - // Meter:CustomDifference // Output:Table:Monthly // Output:Table:TimeBins // Output:Table:SummaryReports @@ -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"); diff --git a/src/Transition/CreateNewIDFUsingRulesV9_4_0.f90 b/src/Transition/CreateNewIDFUsingRulesV9_4_0.f90 index 829815c83dd..d9d986a79be 100644 --- a/src/Transition/CreateNewIDFUsingRulesV9_4_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesV9_4_0.f90 @@ -129,10 +129,11 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile INTEGER :: nE, nEC, nG, nNG, nFO, nFON LOGICAL :: changeMeterNameFlag - INTEGER :: numMeterCustomNames = 0 + INTEGER :: totMeterCustom = 0 + INTEGER :: totMeterCustomDecr = 0 INTEGER numMeterCustom CHARACTER(len=MaxNameLength) :: MeterCustomName - CHARACTER, ALLOCATABLE, DIMENSION(:) :: MeterCustomNames + 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 ! @@ -302,9 +303,9 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile ! End Pre-process OutputDiagnostics !- Pre-process for names of Meter:Custom objects - numMeterCustomNames = GetNumObjectsFound('METER:CUSTOM') - IF (numMeterCustomNames > 1) THEN - DO numMeterCustom=1, numMeterCustomNames + totMeterCustom = GetNumObjectsFound('METER:CUSTOM') + IF (totMeterCustom > 1) THEN + DO numMeterCustom=1, totMeterCustom CALL GetObjectItem('METER:CUSTOM', numMeterCustom, Alphas, NumAlphas, Numbers, NumNumbers, Status) MeterCustomName = MakeUpperCase(TRIM(Alphas(1))) MeterCustomNames(numMeterCustom) = MeterCustomName @@ -312,7 +313,17 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile END IF !- Ene Pre-process for names of Meter:Custom objects - CALL DisplayString(MeterCustomNames(1)) + !- Pre-process for names of Meter:CustomDecrement objects + totMeterCustomDecr = GetNumObjectsFound('METER:CUSTOMDECREMENT') + IF (totMeterCustomDecr > 1) THEN + DO numMeterCustom=1, totMeterCustomDecr + CALL GetObjectItem('METER:CUSTOMDECREMENT', numMeterCustom, Alphas, NumAlphas, Numbers, NumNumbers, Status) + MeterCustomName = MakeUpperCase(TRIM(Alphas(1))) + CALL DisplayString(MeterCustomName) + 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 ! @@ -626,9 +637,9 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile IF (DelThis) CYCLE IF (CurArgs .GE. 1) THEN changeMeterNameFlag = .true. - DO numMeterCustom=1, numMeterCustomNames + DO numMeterCustom=1, totMeterCustom + totMeterCustomDecr MeterCustomName = MeterCustomNames(numMeterCustom) - IF (MeterCustomName .eq. InArgs(1)) THEN + IF (MeterCustomName .eq. MakeUPPERCase(InArgs(1))) THEN changeMeterNameFlag = .false. END IF END DO From 9b6f1b1ec669543d0d4711c6360396cdf75eb5ca Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 22 Sep 2020 20:24:38 -0600 Subject: [PATCH 3/3] fix IF block bounds --- src/Transition/CreateNewIDFUsingRulesV9_4_0.f90 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Transition/CreateNewIDFUsingRulesV9_4_0.f90 b/src/Transition/CreateNewIDFUsingRulesV9_4_0.f90 index d9d986a79be..0cfda818482 100644 --- a/src/Transition/CreateNewIDFUsingRulesV9_4_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesV9_4_0.f90 @@ -304,7 +304,7 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile !- Pre-process for names of Meter:Custom objects totMeterCustom = GetNumObjectsFound('METER:CUSTOM') - IF (totMeterCustom > 1) THEN + IF (totMeterCustom > 0) THEN DO numMeterCustom=1, totMeterCustom CALL GetObjectItem('METER:CUSTOM', numMeterCustom, Alphas, NumAlphas, Numbers, NumNumbers, Status) MeterCustomName = MakeUpperCase(TRIM(Alphas(1))) @@ -315,11 +315,10 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile !- Pre-process for names of Meter:CustomDecrement objects totMeterCustomDecr = GetNumObjectsFound('METER:CUSTOMDECREMENT') - IF (totMeterCustomDecr > 1) THEN + IF (totMeterCustomDecr > 0) THEN DO numMeterCustom=1, totMeterCustomDecr CALL GetObjectItem('METER:CUSTOMDECREMENT', numMeterCustom, Alphas, NumAlphas, Numbers, NumNumbers, Status) MeterCustomName = MakeUpperCase(TRIM(Alphas(1))) - CALL DisplayString(MeterCustomName) MeterCustomNames(numMeterCustom + totMeterCustom) = MeterCustomName END DO END IF