Skip to content

Commit

Permalink
Fix #10624 by adding a new function GetFieldOrIDDDefault and using …
Browse files Browse the repository at this point in the history
…that when retrieving HX effectivenesses

This will effectively set the values to 0.0 if blank, since that's what the IDD default is for these fields.
  • Loading branch information
jmarrec committed Aug 5, 2024
1 parent 342372b commit 002f02c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 9 deletions.
24 changes: 16 additions & 8 deletions src/Transition/CreateNewIDFUsingRulesV24_1_0.f90
Original file line number Diff line number Diff line change
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))
! 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))

! 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


! 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

! 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

0 comments on commit 002f02c

Please sign in to comment.