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 #10624 - Fix Transition from 23.2.0 to 24.2.0 when a HeatExchanger:AirToAir:SensibleAndLatent has blank effectiveness fields #10639

Merged
merged 2 commits into from
Aug 5, 2024
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
26 changes: 17 additions & 9 deletions src/Transition/CreateNewIDFUsingRulesV24_1_0.f90
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
CHARACTER(20), DIMENSION(4) :: HxEffectAt75Airflow
CHARACTER(20), DIMENSION(4) :: HxEffectAt100Airflow
CHARACTER(MaxNameLength + 2), DIMENSION(4) :: HxTableName
LOGICAL :: tableAdded
LOGICAL :: tableAdded = .false.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Avoid writting Table:IndependentVariable(List) when not needed

LOGICAL :: tableIndependentVarAdded = .false.
CHARACTER(10) :: tableID
REAL :: effect75
Expand Down Expand Up @@ -429,14 +429,22 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile
nodiff=.false.

! read in 8 reference value for the effectiveness at 75% and 100%
HxEffectAt75Airflow(1) = TRIM(InArgs(6)) ! Sensible Effectiveness at 75% Heating Air Flow
HxEffectAt75Airflow(2) = TRIM(InArgs(7)) ! Latent Effectiveness at 75% Heating Air Flow
HxEffectAt75Airflow(3) = TRIM(InArgs(10)) ! Sensible Effectiveness at 75% Cooling Air Flow
HxEffectAt75Airflow(4) = TRIM(InArgs(11)) ! Latent Effectiveness at 75% Cooling Air Flow
HxEffectAt100Airflow(1) = TRIM(InArgs(4)) ! Sensible Effectiveness at 100% Heating Air Flow
HxEffectAt100Airflow(2) = TRIM(InArgs(5)) ! Latent Effectiveness at 100% Heating Air Flow
HxEffectAt100Airflow(3) = TRIM(InArgs(8)) ! Sensible Effectiveness at 100% Cooling Air Flow
HxEffectAt100Airflow(4) = TRIM(InArgs(9)) ! Latent Effectiveness at 100% Cooling Air Flow
! Sensible Effectiveness at 75% Heating Air Flow
HxEffectAt75Airflow(1) = GetFieldOrIDDDefault(InArgs(6), FldDefaults(6))
Copy link
Member

Choose a reason for hiding this comment

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

So FldDefaults will always be populated with meaningful or blank values? I've never used that array so just confirming.

! Latent Effectiveness at 75% Heating Air Flow
HxEffectAt75Airflow(2) = GetFieldOrIDDDefault(InArgs(7), FldDefaults(7))
! Sensible Effectiveness at 75% Cooling Air Flow
HxEffectAt75Airflow(3) = GetFieldOrIDDDefault(InArgs(10), FldDefaults(10))
! Latent Effectiveness at 75% Cooling Air Flow
HxEffectAt75Airflow(4) = GetFieldOrIDDDefault(InArgs(11), FldDefaults(11))
! Sensible Effectiveness at 100% Heating Air Flow
HxEffectAt100Airflow(1) = GetFieldOrIDDDefault(InArgs(4), FldDefaults(4))
! Latent Effectiveness at 100% Heating Air Flow
HxEffectAt100Airflow(2) = GetFieldOrIDDDefault(InArgs(5), FldDefaults(5))
! Sensible Effectiveness at 100% Cooling Air Flow
HxEffectAt100Airflow(3) = GetFieldOrIDDDefault(InArgs(8), FldDefaults(8))
! Latent Effectiveness at 100% Cooling Air Flow
HxEffectAt100Airflow(4) = GetFieldOrIDDDefault(InArgs(9), FldDefaults(9))
Comment on lines +432 to +447
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use it.


! Remove the 4 fields for 75% airflow and adjust the index of the fields
OutArgs(1:5) = InArgs(1:5)
Expand Down
23 changes: 22 additions & 1 deletion src/Transition/InputProcessor.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4814,6 +4814,28 @@ FUNCTION IPTrimSigDigits(IntegerValue) RESULT(OutputString)

END FUNCTION IPTrimSigDigits

FUNCTION GetFieldOrIDDDefault(InArgString, FldDefaultString) RESULT (ResultString)

! PURPOSE OF THIS SUBROUTINE:
! If InArgString is Blank, replace with FldDefaultString

IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
Copy link
Member

Choose a reason for hiding this comment

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

Implicit None is already declared at the top of the module, so probably not necessary, but totally fine.



! FUNCTION ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: InArgString ! Input String
CHARACTER(len=*), INTENT(IN) :: FldDefaultString ! Default String
CHARACTER(len=LEN(InArgString)) :: ResultString ! Result String

ResultString=InArgString
IF (ResultString == Blank) THEN
ResultString = FldDefaultString
ENDIF

RETURN

END FUNCTION GetFieldOrIDDDefault
Comment on lines +4817 to +4837
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New helper


! NOTICE
!
! Copyright © 1996-2009 The Board of Trustees of the University of Illinois
Expand All @@ -4839,4 +4861,3 @@ END FUNCTION IPTrimSigDigits
!

END MODULE InputProcessor

Loading