SUBROUTINE GetCurveInput
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN May 2000
! MODIFIED January 2006, Rick Strand, added a curve type (quadratic-linear)
! July 2006, L. Gu, added a curve type (bicubic)
! July 2006, BG added triquadratic.
! April 2008, LL Added Linear Curve; July 2008, restructure for easier renaming
! Feb 2009, R. Raustad - FSEC, added exponent curve
! 22Aug2010 Craig Wray, added new curves for fan component model:
! FanPressureRise, ExponentialSkewNormal, Sigmoid, RectangularHyperbola1,
! RectangularHyperbola2, ExponentialDecay
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Obtains input data for EnergyPlus equipment performance curves
! METHODOLOGY EMPLOYED:
! Uses "Get" routines to read in data.
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: GetNumObjectsFound, GetObjectItem, VerifyName, GetObjectDefMaxArgs, FindItemInList,MakeUPPERcase
USE DataIPShortCuts ! Data for field names, blank numerics
USE General, ONLY: RoundSigDigits
! USE DataGlobals, ONLY: DisplayExtraWarnings, OutputFileInits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: NumBiquad ! Number of biquadratic curve objects in the input data file
INTEGER :: NumCubic ! Number of cubic curve objects in the input data file
INTEGER :: NumQuartic ! Number of quartic (4th order polynomial) objects in the input data file
INTEGER :: NumQuad ! Number of quadratic curve objects in the input data file
INTEGER :: NumQuadLinear ! Number of quadratic linear curve objects in the input data file
INTEGER :: NumQLinear ! Number of quad linear curve objects in the input data file
INTEGER :: NumLinear ! Number of linear curve objects in the input data file
INTEGER :: NumBicubic ! Number of bicubic curve objects in the input data file
INTEGER :: NumTriQuad ! Number of triquadratic curve objects in the input file
INTEGER :: NumExponent ! Number of exponent curve objects in the input file
INTEGER :: NumOneVarTab ! Number of one variable table objects in the input file
INTEGER :: NumTwoVarTab ! Number of two variable table objects in the input file
INTEGER :: NumMultVarLookup ! Number of multivariable tables
INTEGER :: NumLookupTables ! total number of one, two, and multivariable tables
INTEGER :: NumFanPressRise ! cpw22Aug2010 Number of fan pressure rise curve objects in the input file
INTEGER :: NumExpSkewNorm ! cpw22Aug2010 Number of exponential skew normal curve objects in the input file
INTEGER :: NumSigmoid ! cpw22Aug2010 Number of sigmoid curve objects in the input file
INTEGER :: NumRectHyper1 ! cpw22Aug2010 Number of rectangular hyperbola Type 1 curve objects in the input file
INTEGER :: NumRectHyper2 ! cpw22Aug2010 Number of rectangular hyperbola Type 2 curve objects in the input file
INTEGER :: NumExpDecay ! cpw22Aug2010 Number of exponential decay curve objects in the input file
INTEGER :: NumDoubleExpDecay ! ykt July 2011
INTEGER :: NumTables ! Total tables in the input file
INTEGER :: CurveIndex ! do loop index
INTEGER :: CurveNum ! current curve number
CHARACTER(len=MaxNameLength), &
DIMENSION(13) :: Alphas ! Alpha items for object
REAL(r64), DIMENSION(10000) :: Numbers ! Numeric items for object
INTEGER :: NumAlphas ! Number of Alphas for each GetObjectItem call
INTEGER :: NumNumbers ! Number of Numbers for each GetObjectItem call
INTEGER :: IOStatus ! Used in GetObjectItem
LOGICAL :: ErrorsFound=.false. ! Set to true if errors in input, fatal at end of routine
LOGICAL :: IsNotOK ! Flag to verify name
LOGICAL :: IsBlank ! Flag for blank name
CHARACTER(len=MaxNameLength) :: CurrentModuleObject ! for ease in renaming.
INTEGER :: MaxTableNums=0 ! Maximum number of numeric input fields in Tables
INTEGER :: MaxTableData=0 ! Maximum number of numeric input field pairs in Tables
INTEGER :: TotalArgs=0 ! Total number of alpha and numeric arguments (max) for a
! certain object in the input file
INTEGER :: TableNum=0 ! Index to TableData structure
INTEGER :: TableDataIndex=0 ! Loop counter for table data
INTEGER :: NumTableEntries=0 ! Number of data pairs in table data
INTEGER :: NumXVar
INTEGER :: NumX2Var
REAL(r64), ALLOCATABLE, DIMENSION(:):: XVar
REAL(r64), ALLOCATABLE, DIMENSION(:):: X2Var
INTEGER :: VarIndex
INTEGER :: TempVarIndex
INTEGER :: TempVarIndex1
REAL(r64) :: MinTableData
REAL(r64) :: MaxTableDataValue
INTEGER :: NextXVar
LOGICAL :: FoundNewData
Real(r64), ALLOCATABLE, DIMENSION(:) :: TempArray1
Real(r64), ALLOCATABLE, DIMENSION(:) :: TempArray2
Real(r64), ALLOCATABLE, DIMENSION(:) :: TempArray3
CHARACTER(len=MaxNameLength) :: FileName ! name of external table data file
INTEGER,EXTERNAL :: GetNewUnitNumber
LOGICAL :: ReadFromFile ! True if external data file exists
INTEGER :: CurveFound
! Find the number of each type of curve (note: Current Module object not used here, must rename manually)
NumBiQuad = GetNumObjectsFound('Curve:Biquadratic')
NumCubic = GetNumObjectsFound('Curve:Cubic')
NumQuartic = GetNumObjectsFound('Curve:Quartic')
NumQuad = GetNumObjectsFound('Curve:Quadratic')
NumQLinear = GetNumObjectsFound('Curve:QuadLinear')
NumQuadLinear = GetNumObjectsFound('Curve:QuadraticLinear')
NumLinear = GetNumObjectsFound('Curve:Linear')
NumBicubic = GetNumObjectsFound('Curve:Bicubic')
NumTriQuad = GetNumObjectsFound('Curve:Triquadratic')
NumExponent = GetNumObjectsFound('Curve:Exponent')
NumMultVarLookup = GetNumObjectsFound('Table:MultiVariableLookup')
NumFanPressRise = GetNumObjectsFound('Curve:FanPressureRise') !cpw22Aug2010
NumExpSkewNorm = GetNumObjectsFound('Curve:ExponentialSkewNormal') !cpw22Aug2010
NumSigmoid = GetNumObjectsFound('Curve:Sigmoid') !cpw22Aug2010
NumRectHyper1 = GetNumObjectsFound('Curve:RectangularHyperbola1') !cpw22Aug2010
NumRectHyper2 = GetNumObjectsFound('Curve:RectangularHyperbola2') !cpw22Aug2010
NumExpDecay = GetNumObjectsFound('Curve:ExponentialDecay') !cpw22Aug2010
NumDoubleExpDecay=GetNumObjectsFound('Curve:DoubleExponentialDecay') !ykt July 2011
NumOneVarTab = GetNumObjectsFound('Table:OneIndependentVariable')
NumTwoVarTab = GetNumObjectsFound('Table:TwoIndependentVariables')
NumCurves = NumBiQuad + NumCubic + NumQuad + NumQuadLinear + NumLinear + NumBicubic &
+ NumTriQuad + NumExponent + NumQuartic + NumOneVarTab + NumTwoVarTab + NumMultVarLookup &
+ NumFanPressRise + NumExpSkewNorm + NumSigmoid + NumRectHyper1 & !cpw22Aug2010
+ NumRectHyper2 + NumExpDecay + NumDoubleExpDecay + NumQLinear
! intermediate count for one and two variable performance tables
NumTables = NumOneVarTab + NumTwoVarTab
! final count for all tables
NumLookupTables = NumOneVarTab + NumTwoVarTab + NumMultVarLookup
IF(NumLookupTables .GT. 0)ALLOCATE(TableLookup(NumLookupTables))
IF(NumOneVarTab .GT. 0)THEN
CALL GetObjectDefMaxArgs('Table:OneIndependentVariable',TotalArgs,NumAlphas,NumNumbers)
MaxTableNums=MAX(MaxTableNums,NumNumbers)
MaxTableData=MAX(MaxTableData,MaxTableNums)
END IF
IF(NumTwoVarTab .GT. 0)THEN
CALL GetObjectDefMaxArgs('Table:TwoIndependentVariables',TotalArgs,NumAlphas,NumNumbers)
MaxTableNums=MAX(MaxTableNums,NumNumbers)
MaxTableData=MAX(MaxTableData,MaxTableNums)
END IF
! allocate the data structure
ALLOCATE(PerfCurve(NumCurves))
ALLOCATE(PerfCurveTableData(NumLookupTables))
ALLOCATE(TableData(NumLookupTables))
ALLOCATE(TempTableData(NumTables))
ALLOCATE(Temp2TableData(NumTables))
! initialize the array
CurveNum=0
! Loop over biquadratic curves and load data
CurrentModuleObject='Curve:Biquadratic'
DO CurveIndex=1,NumBiQuad
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
! could add checks for blank numeric fields, and use field names for errors.
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = Biquadratic
PerfCurve(CurveNum)%ObjectType = CurveType_Biquadratic
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Coeff4 = Numbers(4)
PerfCurve(CurveNum)%Coeff5 = Numbers(5)
PerfCurve(CurveNum)%Coeff6 = Numbers(6)
PerfCurve(CurveNum)%Var1Min = Numbers(7)
PerfCurve(CurveNum)%Var1Max = Numbers(8)
PerfCurve(CurveNum)%Var2Min = Numbers(9)
PerfCurve(CurveNum)%Var2Max = Numbers(10)
IF(NumNumbers > 10 .AND. .NOT. lNumericFieldBlanks(11))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(11)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 11 .AND. .NOT. lNumericFieldBlanks(12))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(12)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(7) > Numbers(8)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(7))//' ['//TRIM(RoundSigDigits(Numbers(7),2))//'] > '// &
TRIM(cNumericFieldNames(8))//' ['//TRIM(RoundSigDigits(Numbers(8),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(9) > Numbers(10)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(9))//' ['//TRIM(RoundSigDigits(Numbers(9),2))//'] > '// &
TRIM(cNumericFieldNames(10))//' ['//TRIM(RoundSigDigits(Numbers(10),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for Y is invalid.')
END IF
END IF
IF (NumAlphas .GE. 4) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(4))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO
! Loop over cubic curves and load data
CurrentModuleObject='Curve:Cubic'
DO CurveIndex=1,NumCubic
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = Cubic
PerfCurve(CurveNum)%ObjectType = CurveType_Cubic
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Coeff4 = Numbers(4)
PerfCurve(CurveNum)%Var1Min = Numbers(5)
PerfCurve(CurveNum)%Var1Max = Numbers(6)
IF(NumNumbers > 6 .AND. .NOT. lNumericFieldBlanks(7))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(7)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 7 .AND. .NOT. lNumericFieldBlanks(8))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(8)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(5) > Numbers(6)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(5))//'['//TRIM(RoundSigDigits(Numbers(5),2))//'] > '// &
TRIM(cNumericFieldNames(6))//' ['//TRIM(RoundSigDigits(Numbers(6),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO
! Loop over quadrinomial curves and load data
CurrentModuleObject='Curve:Quartic'
DO CurveIndex=1,NumQuartic
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = Quartic
PerfCurve(CurveNum)%ObjectType = CurveType_Quartic
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Coeff4 = Numbers(4)
PerfCurve(CurveNum)%Coeff5 = Numbers(5)
PerfCurve(CurveNum)%Var1Min = Numbers(6)
PerfCurve(CurveNum)%Var1Max = Numbers(7)
IF(NumNumbers > 7 .AND. .NOT. lNumericFieldBlanks(8))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(8)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 8 .AND. .NOT. lNumericFieldBlanks(9))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(9)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(6) > Numbers(7)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(6))//'['//TRIM(RoundSigDigits(Numbers(6),2))//'] > '// &
TRIM(cNumericFieldNames(7))//' ['//TRIM(RoundSigDigits(Numbers(7),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO
! Loop over quadratic curves and load data
CurrentModuleObject='Curve:Quadratic'
DO CurveIndex=1,NumQuad
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = Quadratic
PerfCurve(CurveNum)%ObjectType = CurveType_Quadratic
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Var1Min = Numbers(4)
PerfCurve(CurveNum)%Var1Max = Numbers(5)
IF(NumNumbers > 5 .AND. .NOT. lNumericFieldBlanks(6))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(6)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 6 .AND. .NOT. lNumericFieldBlanks(7))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(7)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(4) > Numbers(5)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(4))//' ['//TRIM(RoundSigDigits(Numbers(4),2))//'] > '// &
TRIM(cNumericFieldNames(5))//' ['//TRIM(RoundSigDigits(Numbers(5),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO
! Loop over quadratic-linear curves and load data
CurrentModuleObject='Curve:QuadraticLinear'
DO CurveIndex=1,NumQuadLinear
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = QuadraticLinear
PerfCurve(CurveNum)%ObjectType = CurveType_QuadraticLinear
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Coeff4 = Numbers(4)
PerfCurve(CurveNum)%Coeff5 = Numbers(5)
PerfCurve(CurveNum)%Coeff6 = Numbers(6)
PerfCurve(CurveNum)%Var1Min = Numbers(7)
PerfCurve(CurveNum)%Var1Max = Numbers(8)
PerfCurve(CurveNum)%Var2Min = Numbers(9)
PerfCurve(CurveNum)%Var2Max = Numbers(10)
IF(NumNumbers > 10 .AND. .NOT. lNumericFieldBlanks(11))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(11)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 11 .AND. .NOT. lNumericFieldBlanks(12))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(12)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(7) > Numbers(8)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(7))//' ['//TRIM(RoundSigDigits(Numbers(7),2))//'] > '// &
TRIM(cNumericFieldNames(8))//' ['//TRIM(RoundSigDigits(Numbers(8),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(9) > Numbers(10)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(9))//' ['//TRIM(RoundSigDigits(Numbers(9),2))//'] > '// &
TRIM(cNumericFieldNames(10))//' ['//TRIM(RoundSigDigits(Numbers(10),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for Y is invalid.')
END IF
END IF
IF (NumAlphas .GE. 4) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(4))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO
! Loop over linear curves and load data
CurrentModuleObject='Curve:Linear'
DO CurveIndex=1,NumLinear
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = Linear
PerfCurve(CurveNum)%ObjectType = CurveType_Linear
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Var1Min = Numbers(3)
PerfCurve(CurveNum)%Var1Max = Numbers(4)
IF(NumNumbers > 4 .AND. .NOT. lNumericFieldBlanks(5))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(5)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 5 .AND. .NOT. lNumericFieldBlanks(6))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(6)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(3) > Numbers(4)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(3))//' ['//TRIM(RoundSigDigits(Numbers(3),2))//'] > '// &
TRIM(cNumericFieldNames(4))//' ['//TRIM(RoundSigDigits(Numbers(4),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO
! Loop over bicubic curves and load data
CurrentModuleObject='Curve:Bicubic'
DO CurveIndex=1,NumBicubic
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = Bicubic
PerfCurve(CurveNum)%ObjectType = CurveType_BiCubic
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Coeff4 = Numbers(4)
PerfCurve(CurveNum)%Coeff5 = Numbers(5)
PerfCurve(CurveNum)%Coeff6 = Numbers(6)
PerfCurve(CurveNum)%Coeff7 = Numbers(7)
PerfCurve(CurveNum)%Coeff8 = Numbers(8)
PerfCurve(CurveNum)%Coeff9 = Numbers(9)
PerfCurve(CurveNum)%Coeff10 = Numbers(10)
PerfCurve(CurveNum)%Var1Min = Numbers(11)
PerfCurve(CurveNum)%Var1Max = Numbers(12)
PerfCurve(CurveNum)%Var2Min = Numbers(13)
PerfCurve(CurveNum)%Var2Max = Numbers(14)
IF(NumNumbers > 14 .AND. .NOT. lNumericFieldBlanks(15))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(15)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 15 .AND. .NOT. lNumericFieldBlanks(16))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(16)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(11) > Numbers(12)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(11))//' ['//TRIM(RoundSigDigits(Numbers(11),2))//'] > '// &
TRIM(cNumericFieldNames(12))//' ['//TRIM(RoundSigDigits(Numbers(12),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(13) > Numbers(14)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(13))//' ['//TRIM(RoundSigDigits(Numbers(13),2))//'] > '// &
TRIM(cNumericFieldNames(14))//' ['//TRIM(RoundSigDigits(Numbers(14),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for Y is invalid.')
END IF
END IF
IF (NumAlphas .GE. 4) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(4))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO
! Loop over Triquadratic curves and load data
CurrentModuleObject='Curve:Triquadratic'
DO CurveIndex=1,NumTriQuad
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = TriQuadratic
PerfCurve(CurveNum)%ObjectType = CurveType_TriQuadratic
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
Allocate(PerfCurve(CurveNum)%Tri2ndOrder(1))
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA0 = Numbers(1)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA1 = Numbers(2)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA2 = Numbers(3)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA3 = Numbers(4)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA4 = Numbers(5)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA5 = Numbers(6)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA6 = Numbers(7)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA7 = Numbers(8)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA8 = Numbers(9)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA9 = Numbers(10)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA10 = Numbers(11)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA11 = Numbers(12)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA12 = Numbers(13)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA13 = Numbers(14)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA14 = Numbers(15)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA15 = Numbers(16)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA16 = Numbers(17)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA17 = Numbers(18)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA18 = Numbers(19)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA19 = Numbers(20)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA20 = Numbers(21)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA21 = Numbers(22)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA22 = Numbers(23)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA23 = Numbers(24)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA24 = Numbers(25)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA25 = Numbers(26)
PerfCurve(CurveNum)%Tri2ndOrder%CoeffA26 = Numbers(27)
PerfCurve(CurveNum)%Var1Min = Numbers(28)
PerfCurve(CurveNum)%Var1Max = Numbers(29)
PerfCurve(CurveNum)%Var2Min = Numbers(30)
PerfCurve(CurveNum)%Var2Max = Numbers(31)
PerfCurve(CurveNum)%Var3Min = Numbers(32)
PerfCurve(CurveNum)%Var3Max = Numbers(33)
IF(NumNumbers > 33 .AND. .NOT. lNumericFieldBlanks(34))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(34)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 34 .AND. .NOT. lNumericFieldBlanks(35))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(35)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(28) > Numbers(29)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(28))//' ['//TRIM(RoundSigDigits(Numbers(28),2))//'] > '// &
TRIM(cNumericFieldNames(29))//' ['//TRIM(RoundSigDigits(Numbers(29),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(30) > Numbers(31)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(30))//' ['//TRIM(RoundSigDigits(Numbers(30),2))//'] > '// &
TRIM(cNumericFieldNames(31))//' ['//TRIM(RoundSigDigits(Numbers(31),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(32) > Numbers(33)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(32))//' ['//TRIM(RoundSigDigits(Numbers(32),2))//'] > '// &
TRIM(cNumericFieldNames(33))//' ['//TRIM(RoundSigDigits(Numbers(33),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for Y is invalid.')
END IF
END IF
IF (NumAlphas .GE. 4) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(4))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for Z is invalid.')
END IF
END IF
IF (NumAlphas .GE. 5) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(5))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO
! Loop over quad linear curves and load data
CurrentModuleObject='Curve:QuadLinear'
DO CurveIndex=1,NumQLinear
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = QuadLinear
PerfCurve(CurveNum)%ObjectType = CurveType_QuadLinear
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Coeff4 = Numbers(4)
PerfCurve(CurveNum)%Coeff5 = Numbers(5)
PerfCurve(CurveNum)%Var1Min = Numbers(6)
PerfCurve(CurveNum)%Var1Max = Numbers(7)
PerfCurve(CurveNum)%Var2Min = Numbers(8)
PerfCurve(CurveNum)%Var2Max = Numbers(9)
PerfCurve(CurveNum)%Var3Min = Numbers(10)
PerfCurve(CurveNum)%Var3Max = Numbers(11)
PerfCurve(CurveNum)%Var4Min = Numbers(12)
PerfCurve(CurveNum)%Var4Max = Numbers(13)
IF(NumNumbers > 13 .AND. .NOT. lNumericFieldBlanks(14))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(14)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 14 .AND. .NOT. lNumericFieldBlanks(15))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(15)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(6) > Numbers(7)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(6))//' ['//TRIM(RoundSigDigits(Numbers(6),2))//'] > '// &
TRIM(cNumericFieldNames(7))//' ['//TRIM(RoundSigDigits(Numbers(7),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(8) > Numbers(9)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(8))//' ['//TRIM(RoundSigDigits(Numbers(8),2))//'] > '// &
TRIM(cNumericFieldNames(9))//' ['//TRIM(RoundSigDigits(Numbers(9),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(10) > Numbers(11)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(10))//' ['//TRIM(RoundSigDigits(Numbers(10),2))//'] > '// &
TRIM(cNumericFieldNames(11))//' ['//TRIM(RoundSigDigits(Numbers(11),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(12) > Numbers(13)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(12))//' ['//TRIM(RoundSigDigits(Numbers(12),2))//'] > '// &
TRIM(cNumericFieldNames(13))//' ['//TRIM(RoundSigDigits(Numbers(13),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for W is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 4) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(4))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for Y is invalid.')
END IF
END IF
IF (NumAlphas .GE. 5) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(5))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for Z is invalid.')
END IF
END IF
IF (NumAlphas .GE. 6) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(6))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO
! Loop over Exponent curves and load data
CurrentModuleObject='Curve:Exponent'
DO CurveIndex=1,NumExponent
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = Exponent
PerfCurve(CurveNum)%ObjectType = CurveType_Exponent
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Var1Min = Numbers(4)
PerfCurve(CurveNum)%Var1Max = Numbers(5)
IF(NumNumbers > 5 .AND. .NOT. lNumericFieldBlanks(6))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(6)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 6 .AND. .NOT. lNumericFieldBlanks(7))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(7)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO
! cpw22Aug2010 Loop over Fan Pressure Rise curves and load data - udated 15Sep2010 for unit types
CurrentModuleObject='Curve:FanPressureRise'
DO CurveIndex=1,NumFanPressRise
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = FanPressureRise
PerfCurve(CurveNum)%ObjectType = CurveType_FanPressureRise
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Coeff4 = Numbers(4)
PerfCurve(CurveNum)%Var1Min = Numbers(5)
PerfCurve(CurveNum)%Var1Max = Numbers(6)
PerfCurve(CurveNum)%Var2Min = Numbers(7)
PerfCurve(CurveNum)%Var2Max = Numbers(8)
IF(NumNumbers > 8 .AND. .NOT. lNumericFieldBlanks(9))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(9)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 9 .AND. .NOT. lNumericFieldBlanks(10))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(10)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(5) > Numbers(6)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(5))//'['//TRIM(RoundSigDigits(Numbers(5),2))//'] > '// &
TRIM(cNumericFieldNames(6))//' ['//TRIM(RoundSigDigits(Numbers(6),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(7) > Numbers(8)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(7))//'['//TRIM(RoundSigDigits(Numbers(7),2))//'] > '// &
TRIM(cNumericFieldNames(8))//' ['//TRIM(RoundSigDigits(Numbers(8),2))//']')
ErrorsFound=.true.
ENDIF
END DO !Fan Pressure Rise
! cpw22Aug2010 Loop over Exponential Skew Normal curves and load data
CurrentModuleObject='Curve:ExponentialSkewNormal'
DO CurveIndex=1,NumExpSkewNorm
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = ExponentialSkewNormal
PerfCurve(CurveNum)%ObjectType = CurveType_ExponentialSkewNormal
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Coeff4 = Numbers(4)
PerfCurve(CurveNum)%Var1Min = Numbers(5)
PerfCurve(CurveNum)%Var1Max = Numbers(6)
IF(NumNumbers > 6 .AND. .NOT. lNumericFieldBlanks(7))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(7)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 7 .AND. .NOT. lNumericFieldBlanks(9))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(9)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(5) > Numbers(6)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(5))//'['//TRIM(RoundSigDigits(Numbers(5),2))//'] > '// &
TRIM(cNumericFieldNames(6))//' ['//TRIM(RoundSigDigits(Numbers(6),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO !Exponential Skew Normal
! cpw22Aug2010 Loop over Sigmoid curves and load data
CurrentModuleObject='Curve:Sigmoid'
DO CurveIndex=1,NumSigmoid
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = Sigmoid
PerfCurve(CurveNum)%ObjectType = CurveType_Sigmoid
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Coeff4 = Numbers(4)
PerfCurve(CurveNum)%Coeff5 = Numbers(5)
PerfCurve(CurveNum)%Var1Min = Numbers(6)
PerfCurve(CurveNum)%Var1Max = Numbers(7)
IF(NumNumbers > 7 .AND. .NOT. lNumericFieldBlanks(8))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(8)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 8 .AND. .NOT. lNumericFieldBlanks(9))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(9)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(6) > Numbers(7)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(6))//'['//TRIM(RoundSigDigits(Numbers(6),2))//'] > '// &
TRIM(cNumericFieldNames(7))//' ['//TRIM(RoundSigDigits(Numbers(7),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO !Sigmoid
! cpw22Aug2010 Loop over Rectangular Hyperbola Type 1 curves and load data
CurrentModuleObject='Curve:RectangularHyperbola1'
DO CurveIndex=1,NumRectHyper1
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = RectangularHyperbola1
PerfCurve(CurveNum)%ObjectType = CurveType_RectangularHyperbola1
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Var1Min = Numbers(4)
PerfCurve(CurveNum)%Var1Max = Numbers(5)
IF(NumNumbers > 5 .AND. .NOT. lNumericFieldBlanks(6))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(6)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 6 .AND. .NOT. lNumericFieldBlanks(7))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(7)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(4) > Numbers(5)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(4))//'['//TRIM(RoundSigDigits(Numbers(4),2))//'] > '// &
TRIM(cNumericFieldNames(5))//' ['//TRIM(RoundSigDigits(Numbers(5),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO !Rectangular Hyperbola Type 1
! cpw22Aug2010 Loop over Rectangular Hyperbola Type 2 curves and load data
CurrentModuleObject='Curve:RectangularHyperbola2'
DO CurveIndex=1,NumRectHyper2
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = RectangularHyperbola2
PerfCurve(CurveNum)%ObjectType = CurveType_RectangularHyperbola2
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Var1Min = Numbers(4)
PerfCurve(CurveNum)%Var1Max = Numbers(5)
IF(NumNumbers > 5 .AND. .NOT. lNumericFieldBlanks(6))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(6)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 6 .AND. .NOT. lNumericFieldBlanks(7))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(7)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(4) > Numbers(5)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(4))//'['//TRIM(RoundSigDigits(Numbers(4),2))//'] > '// &
TRIM(cNumericFieldNames(5))//' ['//TRIM(RoundSigDigits(Numbers(5),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO !Rectangular Hyperbola Type 2
! cpw22Aug2010 Loop over Exponential Decay curves and load data
CurrentModuleObject='Curve:ExponentialDecay'
DO CurveIndex=1,NumExpDecay
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = ExponentialDecay
PerfCurve(CurveNum)%ObjectType = CurveType_ExponentialDecay
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Var1Min = Numbers(4)
PerfCurve(CurveNum)%Var1Max = Numbers(5)
IF(NumNumbers > 5 .AND. .NOT. lNumericFieldBlanks(6))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(6)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 6 .AND. .NOT. lNumericFieldBlanks(7))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(7)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF (Numbers(4) > Numbers(5)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(4))//'['//TRIM(RoundSigDigits(Numbers(4),2))//'] > '// &
TRIM(cNumericFieldNames(5))//' ['//TRIM(RoundSigDigits(Numbers(5),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO !Exponential Decay
! ykt July,2011 Loop over DoubleExponential Decay curves and load data
CurrentModuleObject='Curve:DoubleExponentialDecay'
DO CurveIndex=1,NumDoubleExpDecay
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%CurveType = DoubleExponentialDecay
PerfCurve(CurveNum)%ObjectType = CurveType_DoubleExponentialDecay
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
PerfCurve(CurveNum)%Coeff1 = Numbers(1)
PerfCurve(CurveNum)%Coeff2 = Numbers(2)
PerfCurve(CurveNum)%Coeff3 = Numbers(3)
PerfCurve(CurveNum)%Coeff4 = Numbers(4)
PerfCurve(CurveNum)%Coeff5 = Numbers(5)
PerfCurve(CurveNum)%Var1Min = Numbers(6)
PerfCurve(CurveNum)%Var1Max = Numbers(7)
IF(NumNumbers > 7 .AND. .NOT. lNumericFieldBlanks(8))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(8)
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(NumNumbers > 8 .AND. .NOT. lNumericFieldBlanks(9))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(9)
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
! IF (Numbers(4) > Numbers(5)) THEN ! error
! CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
! CALL ShowContinueError(TRIM(cNumericFieldNames(4))//'['//TRIM(RoundSigDigits(Numbers(4),2))//'] > '// &
! TRIM(cNumericFieldNames(5))//' ['//TRIM(RoundSigDigits(Numbers(5),2))//']')
! ErrorsFound=.true.
! ENDIF
IF (NumAlphas .GE. 2) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(2))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Input Unit Type for X is invalid.')
END IF
END IF
IF (NumAlphas .GE. 3) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(3))) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(Alphas(1)) // &
' the Output Unit Type is invalid.')
END IF
END IF
END DO !Exponential Decay
TableNum = 0
! Loop over one variable tables and load data
CurrentModuleObject='Table:OneIndependentVariable'
DO CurveIndex=1,NumOneVarTab
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
TableNum = TableNum + 1
NumTableEntries = (NumNumbers - 5) / 2
ALLOCATE(TableData(TableNum)%X1(NumTableEntries))
ALLOCATE(TableData(TableNum)%Y(NumTableEntries))
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%ObjectType = CurveType_TableOneIV
PerfCurve(CurveNum)%TableIndex = TableNum
SELECT CASE (Alphas(2))
CASE('LINEAR')
PerfCurve(CurveNum)%CurveType = Linear
TableLookup(TableNum)%InterpolationOrder = 2
CASE('QUADRATIC')
PerfCurve(CurveNum)%CurveType = Quadratic
TableLookup(TableNum)%InterpolationOrder = 3
CASE('CUBIC')
PerfCurve(CurveNum)%CurveType = Cubic
TableLookup(TableNum)%InterpolationOrder = 4
CASE('QUARTIC')
PerfCurve(CurveNum)%CurveType = Quartic
TableLookup(TableNum)%InterpolationOrder = 5
CASE('EXPONENT')
PerfCurve(CurveNum)%CurveType = Exponent
TableLookup(TableNum)%InterpolationOrder = 4
CASE DEFAULT
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(2))//' ['//TRIM(Alphas(2))//'] is not a valid choice. ')
ErrorsFound=.true.
END SELECT
SELECT CASE (Alphas(3))
CASE('LINEARINTERPOLATIONOFTABLE')
PerfCurve(CurveNum)%InterpolationType = LINEARINTERPOLATIONOFTABLE
CASE('LAGRANGEINTERPOLATIONLINEAREXTRAPOLATION')
PerfCurve(CurveNum)%InterpolationType = LAGRANGEINTERPOLATIONLINEAREXTRAPOLATION
CASE('EVALUATECURVETOLIMITS')
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
CASE DEFAULT
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(2))//' ['//TRIM(Alphas(2))//'] is not a valid choice. ')
ErrorsFound=.true.
END SELECT
IF(lNumericFieldBlanks(1))THEN
PerfCurve(CurveNum)%Var1Min = 99999999999.D0
ELSE
PerfCurve(CurveNum)%Var1Min = Numbers(1)
END IF
IF(lNumericFieldBlanks(2))THEN
PerfCurve(CurveNum)%Var1Max = -99999999999.D0
ELSE
PerfCurve(CurveNum)%Var1Max = Numbers(2)
END IF
IF(.NOT. lNumericFieldBlanks(1) .AND. .NOT. lNumericFieldBlanks(2))THEN
IF (Numbers(1) > Numbers(2)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(1))//' ['//TRIM(RoundSigDigits(Numbers(1),2))//'] > '// &
TRIM(cNumericFieldNames(2))//' ['//TRIM(RoundSigDigits(Numbers(2),2))//']')
ErrorsFound=.true.
ENDIF
END IF
IF (NumAlphas .GE. 4) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(4))) THEN
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(4))//' ['//TRIM(Alphas(4))//'] is invalid')
END IF
END IF
IF (NumAlphas .GE. 5) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(5))) THEN
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(5))//' ['//TRIM(Alphas(5))//'] is invlaid')
END IF
END IF
! read this value first to allow normalization of min/max table output fields
IF(.NOT. lNumericFieldBlanks(5))THEN
TableData(TableNum)%NormalPoint = Numbers(5)
IF(Numbers(5) .EQ. 0.0D0)THEN
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError('...'//TRIM(cNumericFieldNames(5))// &
' ['//TRIM(RoundSigDigits(Numbers(5),6))//'] is not a valid choice.')
CALL ShowContinueError('...Setting Normalization Reference to 1 and the simulation continues.')
TableData(TableNum)%NormalPoint = 1.0D0
END IF
ELSE
TableData(TableNum)%NormalPoint = 1.0D0
END IF
IF(.NOT. lNumericFieldBlanks(3))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(3)/TableData(TableNum)%NormalPoint
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(.NOT. lNumericFieldBlanks(4))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(4)/TableData(TableNum)%NormalPoint
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
MaxTableNums = (NumNumbers-5)/2
IF(MOD((NumNumbers-5),2) .NE. 0)THEN
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError('The number of data entries must be evenly divisable by 2. Number of data entries = ' &
//trim(RoundSigDigits(NumNumbers-5)))
ErrorsFound=.true.
ELSE
DO TableDataIndex = 1, MaxTableNums
TableData(TableNum)%X1(TableDataIndex) = Numbers((TableDataIndex-1)*2 + 5 + 1)
TableData(TableNum)%Y(TableDataIndex) = Numbers((TableDataIndex-1)*2 + 5 + 2)/ &
TableData(TableNum)%NormalPoint
END DO
END IF
! convert raw table data to multidimensional array
! find number of x variables
NumXVar = 1
NextXVar = 1
TempTableData = TableData
DO WHILE (NumXVar .LE. MaxTableNums)
MinTableData = 999999.0D0
MinTableData = MINVAL(TempTableData(TableNum)%X1)
DO VarIndex = 1, MaxTableNums
IF(TempTableData(TableNum)%X1(VarIndex) .EQ. MinTableData)THEN
TableData(TableNum)%X1(NumXVar) = TempTableData(TableNum)%X1(VarIndex)
TableData(TableNum)%Y(NumXVar) = TempTableData(TableNum)%Y(VarIndex)
TempTableData(TableNum)%X1(VarIndex) = 999999.0D0
NumXVar = NumXVar + 1
END IF
END DO
NextXVar = NumXVar
END DO
! move table data to performance curve table data structure
ALLOCATE(PerfCurveTableData(TableNum)%X1(NumXVar-1))
ALLOCATE(PerfCurveTableData(TableNum)%Y(NumXVar-1,1))
PerfCurveTableData(TableNum)%X1 = TableData(TableNum)%X1
DO VarIndex = 1, NumXVar-1
PerfCurveTableData(TableNum)%Y(VarIndex,1) = TableData(TableNum)%Y(VarIndex)
END DO
! create curve objects when regression analysis is required
IF(PerfCurve(CurveNum)%InterpolationType .EQ. EVALUATECURVETOLIMITS)THEN
SELECT CASE(PerfCurve(CurveNum)%CurveType)
CASE(LINEAR,QUADRATIC,CUBIC,QUARTIC)
ALLOCATE(TempArray1(SIZE(PerfCurveTableData(TableNum)%X1)))
TempArray1 = PerfCurveTableData(TableNum)%X1
ALLOCATE(TempArray2(SIZE(PerfCurveTableData(TableNum)%Y)))
DO VarIndex = 1, SIZE(PerfCurveTableData(TableNum)%Y)
TempArray2(VarIndex) = PerfCurveTableData(TableNum)%Y(VarIndex,1)
END DO
CALL SolveRegression(CurveNum,CurrentModuleObject,PerfCurve(CurveNum)%Name,TempArray1,TempArray2)
DEALLOCATE(TempArray1)
DEALLOCATE(TempArray2)
CASE DEFAULT
CALL ShowWarningError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError('The requested regression analysis is not available at this time. Curve type = ' &
//Alphas(2))
PerfCurve(CurveIndex)%InterpolationType = LinearInterpolationOfTable
END SELECT
END IF
! move table data to more compact array to allow interpolation using multivariable lookup table method
TableLookup(TableNum)%NumIndependentVars = 1
TableLookup(TableNum)%NumX1Vars = SIZE(PerfCurveTableData(TableNum)%X1)
ALLOCATE(TableLookup(TableNum)%X1Var(TableLookup(TableNum)%NumX1Vars))
ALLOCATE(TableLookup(TableNum)%TableLookupZData(SIZE(PerfCurveTableData(TableNum)%Y),1,1,1,1))
TableLookup(TableNum)%X1Var = PerfCurveTableData(TableNum)%X1
TableLookup(TableNum)%TableLookupZData(:,1,1,1,1) = PerfCurveTableData(TableNum)%Y(:,1)
END DO
! Loop over two variable tables and load data
CurrentModuleObject='Table:TwoIndependentVariables'
DO CurveIndex=1,NumTwoVarTab
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
TableNum = TableNum + 1
NumTableEntries = (NumNumbers - 7) / 3
ALLOCATE(TableData(TableNum)%X1(NumTableEntries))
ALLOCATE(TableData(TableNum)%X2(NumTableEntries))
ALLOCATE(TableData(TableNum)%Y(NumTableEntries))
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%ObjectType = CurveType_TableTwoIV
PerfCurve(CurveNum)%TableIndex = TableNum
SELECT CASE (Alphas(2))
CASE('BICUBIC')
PerfCurve(CurveNum)%CurveType = BiCubic
TableLookup(TableNum)%InterpolationOrder = 4
CASE('BIQUADRATIC')
PerfCurve(CurveNum)%CurveType = BiQuadratic
TableLookup(TableNum)%InterpolationOrder = 3
CASE('QUADRATICLINEAR')
PerfCurve(CurveNum)%CurveType = QuadraticLinear
TableLookup(TableNum)%InterpolationOrder = 3
CASE('TRIQUADRATIC')
PerfCurve(CurveNum)%CurveType = TriQuadratic
TableLookup(TableNum)%InterpolationOrder = 3
CASE DEFAULT
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(2))//' ['//TRIM(Alphas(2))//'] is not a valid choice. ')
ErrorsFound=.true.
END SELECT
SELECT CASE (Alphas(3))
CASE('LINEARINTERPOLATIONOFTABLE')
PerfCurve(CurveNum)%InterpolationType = LINEARINTERPOLATIONOFTABLE
CASE('LAGRANGEINTERPOLATIONLINEAREXTRAPOLATION')
PerfCurve(CurveNum)%InterpolationType = LAGRANGEINTERPOLATIONLINEAREXTRAPOLATION
CASE('EVALUATECURVETOLIMITS')
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
CASE DEFAULT
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(2))//' ['//TRIM(Alphas(2))//'] is not a valid choice. ')
ErrorsFound=.true.
END SELECT
PerfCurve(CurveNum)%Var1Min = Numbers(1)
PerfCurve(CurveNum)%Var1Max = Numbers(2)
PerfCurve(CurveNum)%Var2Min = Numbers(3)
PerfCurve(CurveNum)%Var2Max = Numbers(4)
IF (Numbers(1) > Numbers(2)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(1))//' ['//TRIM(RoundSigDigits(Numbers(1),2))//'] > '// &
TRIM(cNumericFieldNames(2))//' ['//TRIM(RoundSigDigits(Numbers(2),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(3) > Numbers(4)) THEN ! error
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(3))//' ['//TRIM(RoundSigDigits(Numbers(3),2))//'] > '// &
TRIM(cNumericFieldNames(4))//' ['//TRIM(RoundSigDigits(Numbers(4),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 4) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(4))) THEN
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(4))//' ['//TRIM(Alphas(4))//'] is invlaid')
END IF
END IF
IF (NumAlphas .GE. 5) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(5))) THEN
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(5))//' ['//TRIM(Alphas(5))//'] is invlaid')
END IF
END IF
IF (NumAlphas .GE. 6) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(6))) THEN
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(6))//' ['//TRIM(Alphas(6))//'] is invlaid')
END IF
END IF
IF(.NOT. lNumericFieldBlanks(7))THEN
TableData(TableNum)%NormalPoint = Numbers(7)
IF(Numbers(7) .EQ. 0.0D0)THEN
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError('...'//TRIM(cNumericFieldNames(7))// &
' ['//TRIM(RoundSigDigits(Numbers(7),6))//'] is not a valid choice.')
CALL ShowContinueError('...Setting Normalization Reference to 1 and the simulation continues.')
TableData(TableNum)%NormalPoint = 1.0D0
END IF
ELSE
TableData(TableNum)%NormalPoint = 1.0D0
END IF
IF(.NOT. lNumericFieldBlanks(5))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(5)/TableData(TableNum)%NormalPoint
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(.NOT. lNumericFieldBlanks(6))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(6)/TableData(TableNum)%NormalPoint
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
MaxTableNums = (NumNumbers-7)/3
IF(MOD((NumNumbers-7),3) .NE. 0)THEN
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError('The number of data entries must be evenly divisable by 3. Number of data entries = ' &
//trim(RoundSigDigits(NumNumbers-7)))
ErrorsFound=.true.
ELSE
DO TableDataIndex = 1, MaxTableNums
TableData(TableNum)%X1(TableDataIndex) = Numbers((TableDataIndex-1)*3 + 7 + 1)
TableData(TableNum)%X2(TableDataIndex) = Numbers((TableDataIndex-1)*3 + 7 + 2)
TableData(TableNum)%Y(TableDataIndex) = Numbers((TableDataIndex-1)*3 + 7 + 3)/ &
TableData(TableNum)%NormalPoint
END DO
END IF
! convert raw table data to multidimensional array
! find number of x variables
ALLOCATE(Xvar(MaxTableNums))
ALLOCATE(X2var(MaxTableNums))
NumXVar = 1
NextXVar = 1
XVar(1) = 1.0D0
TempTableData = TableData
Temp2TableData = TableData
DO WHILE (NumXVar .LE. MaxTableNums)
MinTableData = 999999.0D0
MinTableData = MINVAL(TempTableData(TableNum)%X1)
DO VarIndex = 1, MaxTableNums
IF(TempTableData(TableNum)%X1(VarIndex) .EQ. MinTableData)THEN
TableData(TableNum)%X1(NumXVar) = TempTableData(TableNum)%X1(VarIndex)
TableData(TableNum)%X2(NumXVar) = TempTableData(TableNum)%X2(VarIndex)
TableData(TableNum)%Y(NumXVar) = TempTableData(TableNum)%Y(VarIndex)
TempTableData(TableNum)%X1(VarIndex) = 999999.0D0
NumXVar = NumXVar + 1
END IF
END DO
Temp2TableData(TableNum)%X2(NextXVar:NumXVar-1) = &
TableData(TableNum)%X2(NextXVar:NumXVar-1)
Temp2TableData(TableNum)%Y(NextXVar:NumXVar-1) = &
TableData(TableNum)%Y(NextXVar:NumXVar-1)
DO TempVarIndex = NumXVar-1, NextXVar, -1
MaxTableDataValue = -999999.0D0
DO TempVarIndex1 = NextXVar, NumXVar-1
IF(Temp2TableData(TableNum)%X2(TempVarIndex1) .GT. MaxTableDataValue)THEN
MaxTableDataValue = Temp2TableData(TableNum)%X2(TempVarIndex1)
END IF
END DO
DO TempVarIndex1 = NextXVar, NumXVar-1
IF(Temp2TableData(TableNum)%X2(TempVarIndex1) .NE. MaxTableDataValue)CYCLE
TableData(TableNum)%X2(TempVarIndex) = &
Temp2TableData(TableNum)%X2(TempVarIndex1)
TableData(TableNum)%Y(TempVarIndex) = &
Temp2TableData(TableNum)%Y(TempVarIndex1)
Temp2TableData(TableNum)%X2(TempVarIndex1) = -999999.0D0
EXIT
END DO
END DO
NextXVar = NumXVar
END DO
! reorganize table data
NumXVar = 1
NumX2Var = 1
XVar(1)= TableData(TableNum)%X1(1)
DO VarIndex = 2, MaxTableNums
IF(TableData(TableNum)%X1(VarIndex) .NE. &
TableData(TableNum)%X1(VarIndex-1)) THEN
NumXVar = NumXVar + 1
XVar(NumXVar)= TableData(TableNum)%X1(VarIndex)
END IF
END DO
X2Var(1) = TableData(TableNum)%X2(1)
DO VarIndex = 2, MaxTableNums
FoundNewData = .TRUE.
DO TempVarIndex = 1, NumX2Var
IF(TableData(TableNum)%X2(VarIndex) .EQ. &
X2Var(TempVarIndex)) THEN
FoundNewData = .FALSE.
END IF
END DO
IF(FoundNewData)THEN
NumX2Var = NumX2Var + 1
X2Var(NumX2Var) = TableData(TableNum)%X2(VarIndex)
END IF
END DO
! move table data to performance curve table data structure
ALLOCATE(PerfCurveTableData(TableNum)%X1(NumXVar))
ALLOCATE(PerfCurveTableData(TableNum)%X2(NumX2Var))
ALLOCATE(PerfCurveTableData(TableNum)%Y(NumXVar,NumX2Var))
PerfCurveTableData(TableNum)%X1 = -9999999.0D0
PerfCurveTableData(TableNum)%X2 = -9999999.0D0
PerfCurveTableData(TableNum)%Y = -9999999.0D0
DO VarIndex = 1, NumXVar
PerfCurveTableData(TableNum)%X1(VarIndex) = XVar(VarIndex)
DO TempVarIndex = 1, NumX2Var
PerfCurveTableData(TableNum)%X2(TempVarIndex) = X2Var(TempVarIndex)
DO TempVarIndex1 = 1, MaxTableNums
IF((TableData(TableNum)%X1(TempVarIndex1) .EQ. &
PerfCurveTableData(TableNum)%X1(VarIndex)) .AND. &
(TableData(TableNum)%X2(TempVarIndex1) .EQ. &
PerfCurveTableData(TableNum)%X2(TempVarIndex)))THEN
PerfCurveTableData(TableNum)%Y(VarIndex,TempVarIndex) = &
TableData(TableNum)%Y(TempVarIndex1)
END IF
END DO
END DO
END DO
DEALLOCATE(Xvar)
DEALLOCATE(X2var)
! create curve objects when regression analysis is required
IF(PerfCurve(CurveNum)%InterpolationType .EQ. EVALUATECURVETOLIMITS)THEN
SELECT CASE(PerfCurve(CurveNum)%CurveType)
CASE(BIQUADRATIC,QUADRATICLINEAR)
ALLOCATE(TempArray1(SIZE(TableData(TableNum)%X1)))
TempArray1 = TableData(TableNum)%X1
ALLOCATE(TempArray3(SIZE(TableData(TableNum)%X2)))
TempArray3 = TableData(TableNum)%X2
ALLOCATE(TempArray2(SIZE(TableData(TableNum)%Y)))
DO VarIndex = 1, SIZE(TableData(TableNum)%Y)
TempArray2(VarIndex) = TableData(TableNum)%Y(VarIndex)
END DO
CALL SolveRegression(CurveNum,CurrentModuleObject,PerfCurve(CurveNum)%Name,TempArray1,TempArray2,TempArray3)
DEALLOCATE(TempArray1)
DEALLOCATE(TempArray2)
DEALLOCATE(TempArray3)
CASE DEFAULT
CALL ShowWarningError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError('The requested regression analysis is not available at this time. Curve type = ' &
//Alphas(2))
PerfCurve(CurveIndex)%InterpolationType = LinearInterpolationOfTable
END SELECT
END IF
! move table data to more compact array to allow interpolation using multivariable lookup table method
TableLookup(TableNum)%NumIndependentVars = 2
TableLookup(TableNum)%NumX1Vars = SIZE(PerfCurveTableData(TableNum)%X1)
TableLookup(TableNum)%NumX2Vars = SIZE(PerfCurveTableData(TableNum)%X2)
ALLOCATE(TableLookup(TableNum)%X1Var(TableLookup(TableNum)%NumX1Vars))
ALLOCATE(TableLookup(TableNum)%X2Var(TableLookup(TableNum)%NumX2Vars))
ALLOCATE(TableLookup(TableNum)%TableLookupZData(SIZE(PerfCurveTableData(TableNum)%Y(:,1)), &
SIZE(PerfCurveTableData(TableNum)%Y(1,:)),1,1,1))
TableLookup(TableNum)%X1Var = PerfCurveTableData(TableNum)%X1
TableLookup(TableNum)%X2Var = PerfCurveTableData(TableNum)%X2
TableLookup(TableNum)%TableLookupZData(:,:,1,1,1) = PerfCurveTableData(TableNum)%Y(:,:)
END DO
! Loop over multiple variable tables and load data (strict lookup only - no curve creation
CurrentModuleObject='Table:MultiVariableLookup'
TableNum = NumTables
DO CurveIndex=1,NumMultVarLookup
CALL GetObjectItem(CurrentModuleObject,CurveIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks,AlphaFieldnames=cAlphaFieldNames, &
NumericFieldNames=cNumericFieldNames)
CurveNum = CurveNum+1
TableNum = TableNum + 1
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),PerfCurve%Name,CurveNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
! Need to verify that this name isn't used in Pressure Curves as well.
IF (NumPressureCurves > 0) THEN
CurveFound=FindItemInList(Alphas(1),PressureCurve%Name,NumPressureCurves)
IF (CurveFound /= 0) THEN
CALL ShowSevereError('GetCurveInput: '//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", duplicate curve name.')
CALL ShowContinueError('...Curve name duplicates one of the Pressure Curves. Names must be unique across all curves.')
ErrorsFound=.true.
ENDIF
ENDIF
PerfCurve(CurveNum)%Name = Alphas(1)
PerfCurve(CurveNum)%ObjectType = CurveType_TableMultiIV
PerfCurve(CurveNum)%TableIndex = TableNum
SELECT CASE (Alphas(2))
CASE('LINEARINTERPOLATIONOFTABLE')
PerfCurve(CurveNum)%InterpolationType = LINEARINTERPOLATIONOFTABLE
CASE('LAGRANGEINTERPOLATIONLINEAREXTRAPOLATION')
PerfCurve(CurveNum)%InterpolationType = LAGRANGEINTERPOLATIONLINEAREXTRAPOLATION
CASE('EVALUATECURVETOLIMITS')
PerfCurve(CurveNum)%InterpolationType = EVALUATECURVETOLIMITS
CASE DEFAULT
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(2))//' ['//TRIM(Alphas(2))//'] is not a valid choice. ')
ErrorsFound=.true.
END SELECT
SELECT CASE (Alphas(3))
CASE('LINEAR')
PerfCurve(CurveNum)%CurveType = Linear
CASE('QUADRATIC')
PerfCurve(CurveNum)%CurveType = Quadratic
CASE('CUBIC')
PerfCurve(CurveNum)%CurveType = Cubic
CASE('QUARTIC')
PerfCurve(CurveNum)%CurveType = Quartic
CASE('EXPONENT')
PerfCurve(CurveNum)%CurveType = Exponent
CASE('BIQUADRATIC')
PerfCurve(CurveNum)%CurveType = BiQuadratic
CASE('QUADRATICINEAR')
PerfCurve(CurveNum)%CurveType = QuadraticLinear
CASE('BICUBIC')
PerfCurve(CurveNum)%CurveType = BiCubic
CASE('TRIQUADRATIC')
PerfCurve(CurveNum)%CurveType = TriQuadratic
CASE DEFAULT
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(3))//' ['//TRIM(Alphas(3))//'] is not a valid choice. ')
ErrorsFound=.true.
END SELECT
SELECT CASE (Alphas(4))
CASE('SINGLELINEINDEPENDENTVARIABLEWITHMATRIX')
PerfCurve(CurveNum)%DataFormat = SINGLELINEINDEPENDENTVARIABLEWITHMATRIX
CASE DEFAULT
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(4))//' ['//TRIM(Alphas(4))//'] is not a valid choice. ')
ErrorsFound=.true.
END SELECT
TableLookup(TableNum)%InterpolationOrder = Numbers(1)
IF(.NOT. lNumericFieldBlanks(2))THEN
TableData(TableNum)%NormalPoint = Numbers(2)
IF(Numbers(2) .EQ. 0.0D0)THEN
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError('...'//TRIM(cNumericFieldNames(2))// &
' ['//TRIM(RoundSigDigits(Numbers(2),6))//'] is not a valid choice.')
CALL ShowContinueError('...Setting Normalization Reference to 1 and the simulation continues.')
TableData(TableNum)%NormalPoint = 1.0D0
END IF
ELSE
TableData(TableNum)%NormalPoint = 1.0D0
END IF
PerfCurve(CurveNum)%Var1Min = Numbers(3)
PerfCurve(CurveNum)%Var1Max = Numbers(4)
PerfCurve(CurveNum)%Var2Min = Numbers(5)
PerfCurve(CurveNum)%Var2Max = Numbers(6)
PerfCurve(CurveNum)%Var3Min = Numbers(7)
PerfCurve(CurveNum)%Var3Max = Numbers(8)
PerfCurve(CurveNum)%Var4Min = Numbers(9)
PerfCurve(CurveNum)%Var4Max = Numbers(10)
PerfCurve(CurveNum)%Var5Min = Numbers(11)
PerfCurve(CurveNum)%Var5Max = Numbers(12)
IF (Numbers(3) > Numbers(4)) THEN ! error
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(3))//' ['//TRIM(RoundSigDigits(Numbers(3),2))//'] > '// &
TRIM(cNumericFieldNames(4))//' ['//TRIM(RoundSigDigits(Numbers(4),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(5) > Numbers(6)) THEN ! error
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(5))//' ['//TRIM(RoundSigDigits(Numbers(5),2))//'] > '// &
TRIM(cNumericFieldNames(6))//' ['//TRIM(RoundSigDigits(Numbers(6),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(7) > Numbers(8)) THEN ! error
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(7))//' ['//TRIM(RoundSigDigits(Numbers(7),2))//'] > '// &
TRIM(cNumericFieldNames(8))//' ['//TRIM(RoundSigDigits(Numbers(8),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(9) > Numbers(10)) THEN ! error
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(9))//' ['//TRIM(RoundSigDigits(Numbers(9),2))//'] > '// &
TRIM(cNumericFieldNames(10))//' ['//TRIM(RoundSigDigits(Numbers(10),2))//']')
ErrorsFound=.true.
ENDIF
IF (Numbers(11) > Numbers(12)) THEN ! error
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cNumericFieldNames(11))//' ['//TRIM(RoundSigDigits(Numbers(11),2))//'] > '// &
TRIM(cNumericFieldNames(12))//' ['//TRIM(RoundSigDigits(Numbers(12),2))//']')
ErrorsFound=.true.
ENDIF
IF (NumAlphas .GE. 8) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(8))) THEN
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(8))//' ['//TRIM(Alphas(8))//'] is invlaid')
END IF
END IF
IF (NumAlphas .GE. 9) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(9))) THEN
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(9))//' ['//TRIM(Alphas(9))//'] is invlaid')
END IF
END IF
IF (NumAlphas .GE. 10) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(10))) THEN
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(10))//' ['//TRIM(Alphas(10))//'] is invlaid')
END IF
END IF
IF (NumAlphas .GE. 11) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(11))) THEN
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(11))//' ['//TRIM(Alphas(11))//'] is invlaid')
END IF
END IF
IF (NumAlphas .GE. 12) THEN
IF (.NOT. IsCurveInputTypeValid(Alphas(12))) THEN
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(12))//' ['//TRIM(Alphas(12))//'] is invlaid')
END IF
END IF
IF (NumAlphas .GE. 13) THEN
IF (.NOT. IsCurveOutputTypeValid(Alphas(13))) THEN
CALL ShowSevereError('GetCurveInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError(TRIM(cAlphaFieldNames(13))//' ['//TRIM(Alphas(13))//'] is invlaid')
END IF
END IF
IF(.NOT. lNumericFieldBlanks(13))THEN
PerfCurve(CurveNum)%CurveMin = Numbers(13)/TableData(TableNum)%NormalPoint
PerfCurve(CurveNum)%CurveMinPresent = .TRUE.
END IF
IF(.NOT. lNumericFieldBlanks(14))THEN
PerfCurve(CurveNum)%CurveMax = Numbers(14)/TableData(TableNum)%NormalPoint
PerfCurve(CurveNum)%CurveMaxPresent = .TRUE.
END IF
IF(Alphas(6) .EQ. 'ASCENDING')THEN
PerfCurve(CurveNum)%X1SortOrder=ASCENDING
ELSE IF(Alphas(6) .EQ. 'DESCENDING')THEN
PerfCurve(CurveNum)%X1SortOrder=DESCENDING
ELSE
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError('...Invalid '//TRIM(cAlphaFieldNames(6))//' = '//TRIM(Alphas(6)))
ErrorsFound=.true.
END IF
IF(Alphas(7) .EQ. 'ASCENDING')THEN
PerfCurve(CurveNum)%X2SortOrder=ASCENDING
ELSE IF(Alphas(7) .EQ. 'DESCENDING')THEN
PerfCurve(CurveNum)%X2SortOrder=DESCENDING
ELSE
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError('...Invalid '//TRIM(cAlphaFieldNames(7))//' = '//TRIM(Alphas(7)))
ErrorsFound=.true.
END IF
IF(.NOT. lAlphaFieldBlanks(5))THEN
ReadFromFile = .TRUE.
FileName = Alphas(5)
ELSE
ReadFromFile = .FALSE.
FileName = ' '
END IF
CALL ReadTableData(CurveNum, CurrentModuleObject, ReadFromFile, FileName, Alphas, Numbers, NumNumbers, ErrorsFound)
IF(PerfCurve(CurveNum)%InterpolationType .EQ. EVALUATECURVETOLIMITS)THEN
SELECT CASE(TableLookup(TableNum)%NumIndependentVars)
CASE(1)
ALLOCATE(TempArray1(SIZE(TableLookup(TableNum)%TableLookupZData(:,1,1,1,1))))
ALLOCATE(TempArray2(SIZE(TempArray1)))
TempArray1 = TableLookup(TableNum)%X1Var
TempArray2 = TableLookup(TableNum)%TableLookupZData(:,1,1,1,1)
CALL SolveRegression(CurveNum,CurrentModuleObject,PerfCurve(CurveNum)%Name,TempArray1,TempArray2)
DEALLOCATE(TempArray1)
DEALLOCATE(TempArray2)
! Save array info in performance table arrays in case the performance table routine is selected in regression routine
ALLOCATE(PerfCurveTableData(TableNum)%X1(SIZE(TableLookup(TableNum)%X1Var)))
ALLOCATE(PerfCurveTableData(TableNum)%Y(SIZE(TableLookup(TableNum)%X1Var),1))
PerfCurveTableData(TableNum)%X1 = TableLookup(TableNum)%X1Var
PerfCurveTableData(TableNum)%Y(:,1) = TableLookup(TableNum)%TableLookupZData(:,1,1,1,1)
CASE(2)
ALLOCATE(TempArray1(SIZE(TableLookup(TableNum)%TableLookupZData(:,:,1,1,1))))
ALLOCATE(TempArray2(SIZE(TempArray1)))
ALLOCATE(TempArray3(SIZE(TempArray1)))
TableDataIndex = 0
DO VarIndex = 1, TableLookup(TableNum)%NumX1Vars
DO TempVarIndex = 1, TableLookup(TableNum)%NumX2Vars
TableDataIndex = TableDataIndex + 1
TempArray1(TableDataIndex) = TableLookup(TableNum)%X1Var(VarIndex)
TempArray2(TableDataIndex) = TableLookup(TableNum)%X2Var(TempVarIndex)
TempArray3(TableDataIndex) = TableLookup(TableNum)%TableLookupZData(VarIndex,TempVarIndex,1,1,1)
END DO
END DO
CALL SolveRegression(CurveNum,CurrentModuleObject,PerfCurve(CurveNum)%Name,TempArray1,TempArray3,TempArray2)
DEALLOCATE(TempArray1)
DEALLOCATE(TempArray2)
DEALLOCATE(TempArray3)
! Save array info in performance table arrays in case the performance table routine is selected in regression routine
ALLOCATE(PerfCurveTableData(TableNum)%X1(SIZE(TableLookup(TableNum)%X1Var)))
ALLOCATE(PerfCurveTableData(TableNum)%X2(SIZE(TableLookup(TableNum)%X2Var)))
ALLOCATE(PerfCurveTableData(TableNum)%Y(SIZE(TableLookup(TableNum)%X1Var),SIZE(TableLookup(TableNum)%X2Var)))
PerfCurveTableData(TableNum)%X1 = TableLookup(TableNum)%X1Var
PerfCurveTableData(TableNum)%X2 = TableLookup(TableNum)%X2Var
PerfCurveTableData(TableNum)%Y(:,:) = TableLookup(TableNum)%TableLookupZData(:,:,1,1,1)
CASE DEFAULT
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError('...Invalid '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(Alphas(2)))
CALL ShowContinueError('...Choice not allowed with more than 2 indpendent variables.')
ErrorsFound=.true.
END SELECT
ELSE
SELECT CASE(TableLookup(TableNum)%NumIndependentVars)
CASE(1)
! Save array info in performance table arrays in case the performance table routine is selected in regression routine
ALLOCATE(PerfCurveTableData(TableNum)%X1(SIZE(TableLookup(TableNum)%X1Var)))
ALLOCATE(PerfCurveTableData(TableNum)%Y(SIZE(TableLookup(TableNum)%X1Var),1))
PerfCurveTableData(TableNum)%X1 = TableLookup(TableNum)%X1Var
PerfCurveTableData(TableNum)%Y(:,1) = TableLookup(TableNum)%TableLookupZData(:,1,1,1,1)
! if linear interpolation of table is selected, switch interpolation type
CASE(2)
! Save array info in performance table arrays in case the performance table routine is selected in regression routine
ALLOCATE(PerfCurveTableData(TableNum)%X1(SIZE(TableLookup(TableNum)%X1Var)))
ALLOCATE(PerfCurveTableData(TableNum)%X2(SIZE(TableLookup(TableNum)%X2Var)))
ALLOCATE(PerfCurveTableData(TableNum)%Y(SIZE(TableLookup(TableNum)%X1Var),SIZE(TableLookup(TableNum)%X2Var)))
PerfCurveTableData(TableNum)%X1 = TableLookup(TableNum)%X1Var
PerfCurveTableData(TableNum)%X2 = TableLookup(TableNum)%X2Var
PerfCurveTableData(TableNum)%Y(:,:) = TableLookup(TableNum)%TableLookupZData(:,:,1,1,1)
! if linear interpolation of table is selected, switch interpolation type
CASE DEFAULT
! if linear interpolation of table is selected, fatal if more than 2 independent variables
IF(PerfCurve(CurveNum)%InterpolationType == LINEARINTERPOLATIONOFTABLE)THEN
CALL ShowSevereError('GetTableInput: For '//TRIM(CurrentModuleObject)//': '//TRIM(Alphas(1)))
CALL ShowContinueError('...Invalid '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(Alphas(2)))
CALL ShowContinueError('...Choice not allowed with more than 2 indpendent variables.')
ErrorsFound=.true.
END IF
END SELECT
END IF
END DO
IF (ErrorsFound) THEN
CALL ShowFatalError('GetCurveInput: Errors found in getting Curve Objects. Preceding condition(s) cause termination.')
END IF
RETURN
END SUBROUTINE GetCurveInput