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 | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | PressureCurveName | |||
integer, | intent(inout) | :: | PressureCurveType | |||
integer, | intent(inout) | :: | PressureCurveIndex |
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.
SUBROUTINE GetPressureCurveTypeAndIndex(PressureCurveName, PressureCurveType, PressureCurveIndex)
! SUBROUTINE INFORMATION:
! AUTHOR Edwin Lee
! DATE WRITTEN August 2009
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Given a curve name, returns the curve type and index
! METHODOLOGY EMPLOYED:
! Curve types are:
! PressureCurve_Error = pressure name was given, but curve is not available
! PressureCurve_None = no pressure curve for this branch
! PressureCurve_Pressure = pressure curve based on friction/minor loss
! PressureCurve_Generic = curvemanager held curve which is function of flow rate
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY : FindItemInList
! USE CurveManager, ONLY : GetCurveIndex, GetCurveType
USE DataBranchAirLoopPlant, ONLY : PressureCurve_None, PressureCurve_Pressure, PressureCurve_Generic, PressureCurve_Error
! USE PlantPressureSystem, ONLY: PlantPressureCurveData, PressureCurve
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT (IN) :: PressureCurveName ! name of the curve
INTEGER, INTENT(INOUT) :: PressureCurveType
INTEGER, INTENT(INOUT) :: PressureCurveIndex
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: TempCurveIndex
LOGICAL :: FoundCurve
CHARACTER(len=32) :: GenericCurveType
!If input is not gotten, go ahead and get it now
IF (GetCurvesInputFlag) THEN
CALL GetCurveInput
CALL GetPressureSystemInput
GetCurvesInputFlag=.false.
ENDIF
!Initialize
FoundCurve = .FALSE.
PressureCurveType = PressureCurve_None
PressureCurveIndex = 0
!Try to retrieve a curve manager object
TempCurveIndex = GetCurveIndex(PressureCurveName)
!See if it is valid
IF (TempCurveIndex > 0) THEN
!We have to check the type of curve to make sure it is single independent variable type
GenericCurveType = GetCurveType(TempCurveIndex)
SELECT CASE (GenericCurveType)
CASE ('LINEAR', 'QUADRATIC', 'CUBIC', 'QUARTIC', 'EXPONENT')
PressureCurveType = PressureCurve_Generic
PressureCurveIndex = TempCurveIndex
CASE DEFAULT
CALL ShowSevereError('Plant Pressure Simulation: Found error for curve: '//PressureCurveName)
CALL ShowContinueError('Curve type detected: '//GenericCurveType)
CALL ShowContinueError('Generic curves should be single independent variable such that DeltaP = f(mdot)')
CALL ShowContinueError(' Therefore they should be of type: Linear, Quadratic, Cubic, Quartic, or Exponent')
CALL ShowFatalError('Errors in pressure simulation input cause program termination')
END SELECT
RETURN
END IF
!Then try to retrieve a pressure curve object
IF (ALLOCATED(PressureCurve)) THEN
IF (SIZE(PressureCurve) > 0) THEN
TempCurveIndex = FindItemInList(PressureCurveName,PressureCurve(1:SIZE(PressureCurve))%Name,SIZE(PressureCurve))
ELSE
TempCurveIndex = 0
END IF
END IF
!See if it is valid
IF (TempCurveIndex > 0) THEN
PressureCurveType = PressureCurve_Pressure
PressureCurveIndex = TempCurveIndex
RETURN
END IF
!If we made it here, we didn't find either type of match
!Last check, see if it is blank:
IF (PressureCurveName == ' ') THEN
PressureCurveType = PressureCurve_None
RETURN
END IF
!At this point, we had a non-blank user entry with no match
PressureCurveType = PressureCurve_Error
RETURN
RETURN
END SUBROUTINE GetPressureCurveTypeAndIndex