Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | CurveIndex | |||
real(kind=r64), | intent(in) | :: | Var1 | |||
real(kind=r64), | intent(in), | optional | :: | Var2 | ||
real(kind=r64), | intent(in), | optional | :: | Var3 | ||
real(kind=r64), | intent(in), | optional | :: | Var4 | ||
real(kind=r64), | intent(in), | optional | :: | Var5 |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
REAL(r64) FUNCTION CurveValue(CurveIndex,Var1,Var2,Var3, Var4, Var5)
! FUNCTION INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN May 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! Given the curve index and the values of 1 or 2 independent variables,
! calls the curve or table routine to return the value of an equipment performance curve or table.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataGlobals, ONLY: BeginEnvrnFlag
USE DataInterfaces, ONLY:ShowFatalError
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: CurveIndex ! index of curve in curve array
REAL(r64), INTENT (IN) :: Var1 ! 1st independent variable
REAL(r64), INTENT (IN), OPTIONAL :: Var2 ! 2nd independent variable
REAL(r64), INTENT (IN), OPTIONAL :: Var3 ! 3rd independent variable
REAL(r64), INTENT (IN), OPTIONAL :: Var4 ! 4th independent variable
REAL(r64), INTENT (IN), OPTIONAL :: Var5 ! 5th independent variable
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
LOGICAL, SAVE :: MyBeginTimeStepFlag
! need to be careful on where and how resetting curve outputs to some "iactive value" is done
! EMS can intercept curves and modify output
IF(BeginEnvrnFlag .AND. MyBeginTimeStepFlag)THEN
CALL ResetPerformanceCurveOutput
MyBeginTimeStepFlag = .FALSE.
END IF
IF(.NOT. BeginEnvrnFlag)THEN
MyBeginTimeStepFlag = .TRUE.
END IF
IF ((CurveIndex <= 0) .OR. (CurveIndex > NumCurves)) THEN
CALL ShowFatalError('CurveValue: Invalid curve passed.')
ENDIF
SELECT CASE(PerfCurve(CurveIndex)%InterpolationType)
CASE(EvaluateCurveToLimits)
CurveValue = PerformanceCurveObject(CurveIndex,Var1,Var2,Var3)
CASE(LinearInterpolationOfTable)
CurveValue = PerformanceTableObject(CurveIndex,Var1,Var2,Var3)
CASE(LagrangeInterpolationLinearExtrapolation)
CurveValue = TableLookupObject(CurveIndex,Var1,Var2,Var3,Var4,Var5)
CASE DEFAULT
CALL ShowFatalError('CurveValue: Invalid Interpolation Type')
END SELECT
IF (PerfCurve(CurveIndex)%EMSOverrideOn) CurveValue = PerfCurve(CurveIndex)%EMSOverrideCurveValue
PerfCurve(CurveIndex)%CurveOutput = CurveValue
PerfCurve(CurveIndex)%CurveInput1 = Var1
IF(PRESENT(Var2))PerfCurve(CurveIndex)%CurveInput2 = Var2
IF(PRESENT(Var3))PerfCurve(CurveIndex)%CurveInput3 = Var3
IF(PRESENT(Var4))PerfCurve(CurveIndex)%CurveInput4 = Var4
IF(PRESENT(Var5))PerfCurve(CurveIndex)%CurveInput5 = Var5
RETURN
END FUNCTION CurveValue