Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the resource portion of end-use subcategory meter names in v9.3 to v9.4 transition #8283

Merged
merged 6 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/input-output-reference/src/input-for-output.tex
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ \subsubsection{Field: Name}\label{field-name-1-036}
\endhead

Electricity \tabularnewline
Gas \tabularnewline
NaturalGas \tabularnewline
Gasoline \tabularnewline
Diesel \tabularnewline
Coal \tabularnewline
Expand Down
27 changes: 27 additions & 0 deletions src/Transition/CreateNewIDFUsingRulesV9_4_0.f90
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
CHARACTER(len=MaxNameLength) :: OutputDiagnosticsName
CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: OutputDiagnosticsNames
LOGICAL :: alreadyProcessedOneOutputDiagnostic=.false.
INTEGER :: nE, nEC, nG, nNG, nFO, nFON
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor detail - I think these could be declared in the Subroutine instead of here, but if no other changes are needed, and it's working, then OK.

Copy link
Collaborator Author

@dareumnam dareumnam Sep 17, 2020

Choose a reason for hiding this comment

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

Just moved and pushed again. Oops, already merged. I was 4 mins late.


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! 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 @@ -602,6 +603,9 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
Written, &
.false.)
IF (DelThis) CYCLE
IF (CurArgs .GE. 1) THEN
CALL ReplaceFuelNameWithEndUseSubcategory(OutArgs(1), NoDiff)
END IF

CASE('OUTPUT:TABLE:TIMEBINS')
CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits)
Expand Down Expand Up @@ -1185,3 +1189,26 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
RETURN

END SUBROUTINE CreateNewIDFUsingRules

SUBROUTINE ReplaceFuelNameWithEndUseSubcategory(InOutArg, NoDiffArg)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice solution!

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:)
NoDiffArg=.false.
END IF
IF (nG > 0 .AND. nNG == 0) THEN
InOutArg = InOutArg(:nG-1) // 'NaturalGas'(:10) // InOutArg(nG+3:)
NoDiffArg=.false.
END IF
IF (nFO > 0 .AND. nFON== 0) THEN
InOutArg = InOutArg(:nFO-1) // 'FuelOilNo'(:9) // InOutArg(nFO+8:)
NoDiffArg=.false.
END IF
END SUBROUTINE