Skip to content

Commit

Permalink
Merge pull request #8310 from NREL/test-94-transition
Browse files Browse the repository at this point in the history
Apply IDF Changes from v9.3 to v9.4 Transitions
  • Loading branch information
Myoldmopar committed Sep 29, 2020
2 parents cb78693 + 11ff416 commit f0a4296
Show file tree
Hide file tree
Showing 706 changed files with 42,537 additions and 40,911 deletions.
216 changes: 201 additions & 15 deletions src/Transition/CreateNewIDFUsingRulesV9_4_0.f90
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,8 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
Written, &
.false.)
IF (DelThis) CYCLE

! Begin - Special section for v9.4
IF (CurArgs .GE. 1) THEN
changeMeterNameFlag = .true.
DO numMeterCustom=1, totMeterCustom + totMeterCustomDecr
Expand All @@ -667,6 +669,7 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
CALL ReplaceFuelNameWithEndUseSubcategory(OutArgs(1), NoDiff)
END IF
END IF
! End - Special section for v9.4

CASE('OUTPUT:TABLE:TIMEBINS')
CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits)
Expand All @@ -691,6 +694,21 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
.false.)
IF (DelThis) CYCLE

! Begin - Special section for v9.4
IF (CurArgs .GE. 2) THEN
changeMeterNameFlag = .true.
DO numMeterCustom=1, totMeterCustom + totMeterCustomDecr
MeterCustomName = MeterCustomNames(numMeterCustom)
IF (MeterCustomName .eq. MakeUPPERCase(InArgs(2))) THEN
changeMeterNameFlag = .false.
END IF
END DO
IF (changeMeterNameFlag) THEN
CALL ReplaceFuelNameWithEndUseSubcategory(OutArgs(2), NoDiff)
END IF
END IF
! End - Special section for v9.4

!ExternalInterface:FunctionalMockupUnitImport:From:Variable, field 2
!ExternalInterface:FunctionalMockupUnitExport:From:Variable, field 2
CASE('EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE', &
Expand Down Expand Up @@ -837,7 +855,144 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
EXIT
ENDIF
ENDDO
IF (.not. DelThis) CurVar=CurVar+2
IF (.not. DelThis) THEN

! Begin - Special section for v9.4
changeMeterNameFlag = .true.
DO numMeterCustom=1, totMeterCustom + totMeterCustomDecr
MeterCustomName = MeterCustomNames(numMeterCustom)
IF (MeterCustomName .eq. MakeUPPERCase(InArgs(Var))) THEN
changeMeterNameFlag = .false.
END IF
END DO
IF (changeMeterNameFlag) THEN
CALL ReplaceFuelNameWithEndUseSubcategory(OutArgs(CurVar), NoDiff)
END IF
! End - Special section for v9.4

CurVar=CurVar+2
END IF
ENDDO
CurArgs=CurVar-1

CASE('OUTPUT:TABLE:ANNUAL')
CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits)
nodiff=.true.
OutArgs(1:CurArgs)=InArgs(1:CurArgs)
CurVar=4
DO Var=4,CurArgs,3
UCRepVarName=MakeUPPERCase(InArgs(Var))
OutArgs(CurVar)=InArgs(Var)
OutArgs(CurVar+1)=InArgs(Var+1)
pos=INDEX(UCRepVarName,'[')
IF (pos > 0) THEN
UCRepVarName=UCRepVarName(1:pos-1)
OutArgs(CurVar)=InArgs(Var)(1:pos-1)
OutArgs(CurVar+1)=InArgs(Var+1)
OutArgs(CurVar+2)=InArgs(Var+2)
ENDIF
DelThis=.false.
DO Arg=1,NumRepVarNames
UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg))
IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN
WildMatch=.true.
UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' '
pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName))
ELSE
WildMatch=.false.
pos=0
if (UCRepVarName == UCCompRepVarName) pos=1
ENDIF
IF (pos > 0 .and. pos /= 1) CYCLE
IF (pos > 0) THEN
IF (NewRepVarName(Arg) /= '<DELETE>') THEN
IF (.not. WildMatch) THEN
OutArgs(CurVar)=NewRepVarName(Arg)
ELSE
OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:)
ENDIF
IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN
IF (.not. OTMVarCaution(Arg)) THEN ! caution message not written yet
CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', &
'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// &
'" conversion to Output Table Monthly (new)="'// &
trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".')
write(diflfn,fmtA) ' '
OTMVarCaution(Arg)=.true.
ENDIF
ENDIF
OutArgs(CurVar+1)=InArgs(Var+1)
OutArgs(CurVar+2)=InArgs(Var+2)
nodiff=.false.
ELSE
DelThis=.true.
ENDIF
IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN
IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN
! Adding a var field.
CurVar=CurVar+3
IF (.not. WildMatch) THEN
OutArgs(CurVar)=NewRepVarName(Arg+1)
ELSE
OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:)
ENDIF
IF (NewRepVarCaution(Arg+1) /= Blank) THEN
IF (.not. OTMVarCaution(Arg+1)) THEN ! caution message not written yet
CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', &
'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// &
'" conversion to Output Table Monthly (new)="'// &
trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".')
write(diflfn,fmtA) ' '
OTMVarCaution(Arg+1)=.true.
ENDIF
ENDIF
OutArgs(CurVar+1)=InArgs(Var+1)
OutArgs(CurVar+2)=InArgs(Var+2)
nodiff=.false.
ENDIF
ENDIF
IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN ! only 1 more... for ForkEq
! Adding a var field.
CurVar=CurVar+3
IF (.not. WildMatch) THEN
OutArgs(CurVar)=NewRepVarName(Arg+2)
ELSE
OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:)
ENDIF
IF (NewRepVarCaution(Arg+2) /= Blank) THEN
IF (.not. OTMVarCaution(Arg+2)) THEN ! caution message not written yet
CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', &
'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// &
'" conversion to Output Table Monthly (new)="'// &
trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".')
write(diflfn,fmtA) ' '
OTMVarCaution(Arg+2)=.true.
ENDIF
ENDIF
OutArgs(CurVar+1)=InArgs(Var+1)
OutArgs(CurVar+2)=InArgs(Var+2)
nodiff=.false.
ENDIF
EXIT
ENDIF
ENDDO
IF (.not. DelThis) THEN

! Begin - Special section for v9.4
changeMeterNameFlag = .true.
DO numMeterCustom=1, totMeterCustom + totMeterCustomDecr
MeterCustomName = MeterCustomNames(numMeterCustom)
IF (MeterCustomName .eq. MakeUPPERCase(InArgs(Var))) THEN
changeMeterNameFlag = .false.
END IF
END DO
IF (changeMeterNameFlag) THEN
CALL ReplaceFuelNameWithEndUseSubcategory(OutArgs(CurVar), NoDiff)
END IF
! End - Special section for v9.4

CurVar=CurVar+3
END IF
ENDDO
CurArgs=CurVar-1

Expand Down Expand Up @@ -1255,24 +1410,55 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
END SUBROUTINE CreateNewIDFUsingRules

SUBROUTINE ReplaceFuelNameWithEndUseSubcategory(InOutArg, NoDiffArg)
! Special subroutine for v9.4

CHARACTER(*), INTENT(INOUT) :: InOutArg
LOGICAL, INTENT(INOUT) :: NoDiffArg
nE=INDEX(InOutArg,'Electric')
nEC=INDEX(InOutArg,'Electricity')
nG=INDEX(InOutArg,'Gas')
nNG=INDEX(InOutArg,'NaturalGas')
nFO=INDEX(InOutArg,'FuelOil#')
nFON=INDEX(InOutArg,'FuelOilNo')
IF (nE > 0 .AND. nEC == 0) THEN
InOutArg = InOutArg(:nE-1) // 'Electricity'(:11) // InOutArg(nE+8:)
INTEGER :: lenInArg = 0
lenInArg=Len_Trim(InOutArg)
! Leading resource type
nEa=INDEX(InOutArg,'Electric:')
nECa=INDEX(InOutArg,'Electricity:')
nGa=INDEX(InOutArg,'Gas:')
nNGa=INDEX(InOutArg,'NaturalGas:')
nFO1a=INDEX(InOutArg,'FuelOil#1:')
nFO1Na=INDEX(InOutArg,'FuelOilNo1:')
nFO2a=INDEX(InOutArg,'FuelOil#2:')
nFO2Na=INDEX(InOutArg,'FuelOilNo2:')

! Trailing resource type (resource type is never in the middle :resource: )
nEb=INDEX(InOutArg,':Electric')
nECb=INDEX(InOutArg,':Electricity')
nGb=INDEX(InOutArg,':Gas')
nNGb=INDEX(InOutArg,':NaturalGas')
nFO1b=INDEX(InOutArg,':FuelOil#1')
nFO1Nb=INDEX(InOutArg,':FuelOilNo1')
nFO2b=INDEX(InOutArg,':FuelOil#2')
nFO2Nb=INDEX(InOutArg,':FuelOilNo2')

IF (nEa == 1 .AND. nECa == 0) THEN
InOutArg = 'Electricity:' // InOutArg(nEa+9:lenInArg)
NoDiffArg=.false.
END IF
IF (nG > 0 .AND. nNG == 0) THEN
InOutArg = InOutArg(:nG-1) // 'NaturalGas'(:10) // InOutArg(nG+3:)
ELSE IF (nGa == 1 .AND. nNGa == 0) THEN
InOutArg = 'NaturalGas:' // InOutArg(nGa+4:lenInArg)
NoDiffArg=.false.
END IF
IF (nFO > 0 .AND. nFON== 0) THEN
InOutArg = InOutArg(:nFO-1) // 'FuelOilNo'(:9) // InOutArg(nFO+8:)
ELSE IF (nFO1a == 1 .AND. nFO1Na== 0) THEN
InOutArg = 'FuelOilNo1:' // InOutArg(nFO1a+10:lenInArg)
NoDiffArg=.false.
ELSE IF (nFO2a == 1 .AND. nFO2Na== 0) THEN
InOutArg = 'FuelOilNo2:' // InOutArg(nFO2a+10:lenInArg)
NoDiffArg=.false.
ELSE IF (nEb > 0 .AND. nECb == 0) THEN
InOutArg = InOutArg(1:nEb-1) // ':Electricity'
NoDiffArg=.false.
ELSE IF (nGb > 0 .AND. nNGb == 0) THEN
InOutArg = InOutArg(1:nGb-1) // ':NaturalGas'
NoDiffArg=.false.
ELSE IF (nFO1b > 0 .AND. nFO1Nb == 0) THEN
InOutArg = InOutArg(1:nFO1b-1) // ':FuelOilNo1'
NoDiffArg=.false.
ELSE IF (nFO2b > 0 .AND. nFO2Nb == 0) THEN
InOutArg = InOutArg(1:nFO2b-1) // ':FuelOilNo2'
NoDiffArg=.false.
END IF
END SUBROUTINE
15 changes: 8 additions & 7 deletions src/Transition/SupportFiles/Report Variables 9-3-0 to 9-4-0.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
9.3.0,9.4.0,Transition notes - some of these are EMS variable names,,,,,,
543,543,These numbers should be the number of report variables in the following list (including deletes). Two columns/numbers.,,,,,,
544,544,These numbers should be the number of report variables in the following list (including deletes). Two columns/numbers.,,,,,,
Other Equipment FuelOil#1 Rate,Other Equipment FuelOilNo1 Rate,,,,,,,
Other Equipment FuelOil#2 Rate,Other Equipment FuelOilNo2 Rate,,,,,,,
Exterior Equipment FuelOil#1 Energy,Exterior Equipment FuelOilNo1 Energy,,,,,,,
Expand Down Expand Up @@ -142,6 +142,7 @@ Cooling Coil Evaporative Condenser Pump Electric Energy,Cooling Coil Evaporative
Cooling Tower Fan Electric Power,Cooling Tower Fan Electricity Rate,,,,,,,
Cooling Tower Fan Electric Energy,Cooling Tower Fan Electricity Energy,,,,,,,
Cooling Tower Basin Heater Electric Power,Cooling Tower Basin Heater Electricity Rate,,,,,,,
Cooling Tower Basin Heater Electric Energy,Cooling Tower Basin Heater Electricity Energy,,,,,,,
Zone Cooltower Pump Electric Power,Zone Cooltower Pump Electricity Rate,,,,,,,
Zone Cooltower Pump Electric Energy,Zone Cooltower Pump Electricity Energy,,,,,,,
Heating Coil Electric Power,Heating Coil Electricity Rate,,,,,,,
Expand Down Expand Up @@ -352,10 +353,10 @@ Chiller Heater System Cooling Electric Energy,Chiller Heater System Cooling Elec
Chiller Heater System Heating Electric Energy,Chiller Heater System Heating Electricity Energy,,,,,,,
Chiller Heater System Cooling Electric Power,Chiller Heater System Cooling Electricity Rate,,,,,,,
Chiller Heater System Heating Electric Power,Chiller Heater System Heating Electricity Rate,,,,,,,
Chiller Heater Cooling Electric Power Unit,Chiller Heater Cooling Electricity Rate Unit,,,,,,,
Chiller Heater Heating Electric Power Unit,Chiller Heater Heating Electricity Rate Unit,,,,,,,
Chiller Heater Cooling Electric Energy Unit,Chiller Heater Cooling Electricity Energy Unit,,,,,,,
Chiller Heater Heating Electric Energy Unit,Chiller Heater Heating Electricity Energy Unit,,,,,,,
Chiller Heater Cooling Electric Power Unit*,Chiller Heater Cooling Electricity Rate Unit,,,,,,,
Chiller Heater Heating Electric Power Unit*,Chiller Heater Heating Electricity Rate Unit,,,,,,,
Chiller Heater Cooling Electric Energy Unit*,Chiller Heater Cooling Electricity Energy Unit,,,,,,,
Chiller Heater Heating Electric Energy Unit*,Chiller Heater Heating Electricity Energy Unit,,,,,,,
Environmental Impact Natural Gas Source Energy,Environmental Impact NaturalGas Source Energy,,,,,,,
Environmental Impact Natural Gas CO2 Emissions Mass,Environmental Impact NaturalGas CO2 Emissions Mass,,,,,,,
Environmental Impact Natural Gas CO Emissions Mass,Environmental Impact NaturalGas CO Emissions Mass,,,,,,,
Expand Down Expand Up @@ -515,8 +516,8 @@ Water Heater Off Cycle Ancillary FuelOil#2 Rate,Water Heater Off Cycle Ancillary
Water Heater Off Cycle Ancillary FuelOil#2 Energy,Water Heater Off Cycle Ancillary FuelOilNo2 Energy,,,,,,,
Water Heater On Cycle Ancillary FuelOil#2 Rate,Water Heater On Cycle Ancillary FuelOilNo2 Rate,,,,,,,
Water Heater On Cycle Ancillary FuelOil#2 Energy,Water Heater On Cycle Ancillary FuelOilNo2 Energy,,,,,,,
Water Heater Pump Electric Power,Water Heater Pump NaturalGas Rate,,,,,,,
Water Heater Pump Electric Energy,Water Heater Pump NaturalGas Energy,,,,,,,
Water Heater Pump Electric Power,Water Heater Pump Electricity Rate,,,,,,,
Water Heater Pump Electric Energy,Water Heater Pump Electricity Energy,,,,,,,
Zone Dehumidifier Electric Power,Zone Dehumidifier Electricity Rate,,,,,,,
Zone Dehumidifier Electric Energy,Zone Dehumidifier Electricity Energy,,,,,,,
Zone Dehumidifier Off Cycle Parasitic Electric Power,Zone Dehumidifier Off Cycle Parasitic Electricity Rate,,,,,,,
Expand Down
7 changes: 5 additions & 2 deletions testfiles/1ZoneDataCenterCRAC_wApproachTemp.idf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
No, !- Do System Sizing Calculation
No, !- Do Plant Sizing Calculation
Yes, !- Run Simulation for Sizing Periods
Yes; !- Run Simulation for Weather File Run Periods
Yes, !- Run Simulation for Weather File Run Periods
No, !- Do HVAC Sizing Simulation for Sizing Periods
1; !- Maximum Number of HVAC Sizing Simulation Passes

RunPeriod,
Jan, !- Name
Expand Down Expand Up @@ -1111,7 +1113,7 @@
EnergyManagementSystem:Sensor,
Power_SupplyFan_Elec, !- Name
EC Plug Fan 1, !- Output:Variable or Output:Meter Index Key Name
Fan Electricity Rate; !- Output:Variable or Output:Meter Name
Fan Electricity Rate; !- Output:Variable or Output:Meter Name

EnergyManagementSystem:Sensor,
DeltaT_SupplyFan, !- Name
Expand Down Expand Up @@ -1222,3 +1224,4 @@
ENDIF; !- <none>

Output:Variable,*,PUE,Hourly;

7 changes: 5 additions & 2 deletions testfiles/1ZoneDataCenterCRAC_wPumpedDXCoolingCoil.idf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
No, !- Do System Sizing Calculation
No, !- Do Plant Sizing Calculation
Yes, !- Run Simulation for Sizing Periods
No; !- Run Simulation for Weather File Run Periods
No, !- Run Simulation for Weather File Run Periods
No, !- Do HVAC Sizing Simulation for Sizing Periods
1; !- Maximum Number of HVAC Sizing Simulation Passes

RunPeriod,
Jan, !- Name
Expand Down Expand Up @@ -1105,7 +1107,7 @@
EnergyManagementSystem:Sensor,
Power_SupplyFan_Elec, !- Name
EC Plug Fan 1, !- Output:Variable or Output:Meter Index Key Name
Fan Electricity Rate; !- Output:Variable or Output:Meter Name
Fan Electricity Rate; !- Output:Variable or Output:Meter Name

EnergyManagementSystem:Sensor,
DeltaT_SupplyFan, !- Name
Expand Down Expand Up @@ -1216,3 +1218,4 @@
ENDIF; !- <none>

Output:Variable,*,PUE,Hourly;

4 changes: 3 additions & 1 deletion testfiles/1ZoneEvapCooler.idf
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
No, !- Do System Sizing Calculation
No, !- Do Plant Sizing Calculation
Yes, !- Run Simulation for Sizing Periods
Yes; !- Run Simulation for Weather File Run Periods
Yes, !- Run Simulation for Weather File Run Periods
No, !- Do HVAC Sizing Simulation for Sizing Periods
1; !- Maximum Number of HVAC Sizing Simulation Passes

RunPeriod,
Run Period 1, !- Name
Expand Down
4 changes: 3 additions & 1 deletion testfiles/1ZoneParameterAspect.idf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@
No, !- Do System Sizing Calculation
No, !- Do Plant Sizing Calculation
Yes, !- Run Simulation for Sizing Periods
Yes; !- Run Simulation for Weather File Run Periods
Yes, !- Run Simulation for Weather File Run Periods
No, !- Do HVAC Sizing Simulation for Sizing Periods
1; !- Maximum Number of HVAC Sizing Simulation Passes

RunPeriod,
Run Period 1, !- Name
Expand Down
4 changes: 3 additions & 1 deletion testfiles/1ZoneUncontrolled.idf
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@
No, !- Do System Sizing Calculation
No, !- Do Plant Sizing Calculation
Yes, !- Run Simulation for Sizing Periods
Yes; !- Run Simulation for Weather File Run Periods
Yes, !- Run Simulation for Weather File Run Periods
No, !- Do HVAC Sizing Simulation for Sizing Periods
1; !- Maximum Number of HVAC Sizing Simulation Passes

RunPeriod,
Run Period 1, !- Name
Expand Down
Loading

0 comments on commit f0a4296

Please sign in to comment.