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.
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.
SUBROUTINE GetAngleFactorList
! SUBROUTINE INFORMATION:
! AUTHOR Jaewook Lee
! DATE WRITTEN July 2001
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataGlobals
USE DataHeatBalance
USE DataSurfaces, ONLY : Surface, TotSurfaces
USE InputProcessor, ONLY : GetNumObjectsFound, GetObjectItem, FindItemInList
USE DataIPShortCuts
USE General, ONLY : RoundSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64), PARAMETER :: AngleFacLimit = 0.01d0 ! To set the limit of sum of angle factors
CHARACTER(len=*), PARAMETER :: Blank = ' '
INTEGER, PARAMETER :: MaxSurfaces = 20 ! Maximum number of surfaces in each AngleFactor List
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
!unused1208 CHARACTER(len=MaxNameLength), &
! DIMENSION(22) :: Alphas ! Alpha strings from Input Processor
REAL(r64) :: AllAngleFacSummed ! Sum of angle factors in each zone
LOGICAL :: ErrorsFound=.false. ! Set to true if errors in input, fatal at end of routine
INTEGER :: IOStatus
INTEGER :: Item ! Item to be "gotten"
INTEGER :: NumAlphas ! Number of Alphas from InputProcessor
!unused1208 REAL(r64), DIMENSION(20) :: Numbers ! Numbers from Input Processor
INTEGER :: NumNumbers ! Number of Numbers from Input Processor
INTEGER :: NumOfAngleFactorLists ! Number of Angle Factor Lists found in IDF
INTEGER :: SurfNum ! Surface number DO loop counter
INTEGER :: WhichAFList ! Used in validating AngleFactorList
cCurrentModuleObject='ComfortViewFactorAngles'
NumOfAngleFactorLists = GetNumObjectsFound(cCurrentModuleObject)
ALLOCATE(AngleFactorList(NumOfAngleFactorLists))
AngleFactorList%Name = Blank
AngleFactorList%ZoneName = Blank
AngleFactorList%ZonePtr = 0
DO Item = 1, NumOfAngleFactorLists
AllAngleFacSummed = 0.0d0
CALL GetObjectItem(cCurrentModuleObject,Item,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,IOStatus, &
NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
AngleFactorList(Item)%Name = cAlphaArgs(1) ! no need for verification/uniqueness.
AngleFactorList(Item)%ZoneName = cAlphaArgs(2)
AngleFactorList(Item)%ZonePtr = FindIteminList(cAlphaArgs(2),Zone%Name,NumOfZones)
IF (AngleFactorList(Item)%ZonePtr == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//trim(cAlphaArgs(1))//'", '// &
'invalid - not found')
CALL ShowContinueError('...invalid '//TRIM(cAlphaFieldNames(2))//'="'//trim(cAlphaArgs(2))//'".')
ErrorsFound=.true.
END IF
AngleFactorList(Item)%TotAngleFacSurfaces = NumNumbers
IF (AngleFactorList(Item)%TotAngleFacSurfaces > MaxSurfaces) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': Too many surfaces specified in '//TRIM(cAlphaFieldNames(1))// &
'='//TRIM(cAlphaArgs(1)))
ErrorsFound=.true.
END IF
ALLOCATE(AngleFactorList(Item)%SurfaceName(AngleFactorList(Item)%TotAngleFacSurfaces))
ALLOCATE(AngleFactorList(Item)%SurfacePtr(AngleFactorList(Item)%TotAngleFacSurfaces))
ALLOCATE(AngleFactorList(Item)%AngleFactor(AngleFactorList(Item)%TotAngleFacSurfaces))
DO SurfNum = 1, AngleFactorList(Item)%TotAngleFacSurfaces
AngleFactorList(Item)%SurfaceName(SurfNum) = cAlphaArgs(SurfNum+2)
AngleFactorList(Item)%SurfacePtr(SurfNum) = FindIteminList(cAlphaArgs(SurfNum+2),Surface%Name,TotSurfaces)
AngleFactorList(Item)%AngleFactor(SurfNum) = rNumericArgs(SurfNum)
! Error trap for surfaces that do not exist or surfaces not in the zone
IF (AngleFactorList(Item)%SurfacePtr(SurfNum) == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': invalid '//TRIM(cAlphaFieldNames(SurfNum+2))// &
', entered value='//TRIM(cAlphaArgs(SurfNum+2)))
CALL ShowContinueError('ref '//TRIM(cAlphaFieldNames(1))//'='//TRIM(cAlphaArgs(1))// &
' not found in '//TRIM(cAlphaFieldNames(2))//'='//TRIM(cAlphaArgs(2)))
ErrorsFound=.true.
ELSEIF (AngleFactorList(Item)%ZonePtr /= 0) THEN ! don't look at invalid zones
! Found Surface, is it in same zone tagged for Angle Factor List?
IF (AngleFactorList(Item)%ZonePtr /= Surface(AngleFactorList(Item)%SurfacePtr(SurfNum))%Zone) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//trim(cAlphaArgs(1))//'", invalid - mismatch '// &
TRIM(cAlphaFieldNames(2))//'="'//trim(cAlphaArgs(2))//'"')
CALL ShowContinueError('... does not match '//trim(cAlphaFieldNames(2))//'="'// &
trim(Zone(Surface(AngleFactorList(Item)%SurfacePtr(SurfNum))%Zone)%Name)// &
'" for '//trim(cAlphaFieldNames(SurfNum+2))//'="'//trim(cAlphaArgs(SurfNum+2))//'".')
ErrorsFound=.true.
ENDIF
END IF
AllAngleFacSummed = AllAngleFacSummed + AngleFactorList(Item)%AngleFactor(SurfNum)
END DO
IF (ABS(AllAngleFacSummed-1.0d0) > AngleFacLimit) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//trim(cAlphaArgs(1))//'", invalid - Sum[AngleFactors]')
CALL ShowContinueError('...Sum of Angle Factors ['//trim(RoundSigDigits(AllAngleFacSummed,3))// &
'] exceed expected sum [1.0] by more than limit ['//TRIM(RoundSigDigits(AngleFacLimit,3))//'].')
ErrorsFound=.true.
END IF
END DO
IF (ErrorsFound) THEN
CALL ShowFatalError('GetAngleFactorList: Program terminated due to preceding errors.')
END IF
DO Item = 1, TotPeople
IF(People(Item)%MRTCalcType /= AngleFactor) CYCLE
People(Item)%AngleFactorListPtr = FindIteminList(People(Item)%AngleFactorListName,AngleFactorList%Name,NumOfAngleFactorLists)
WhichAFList=People(Item)%AngleFactorListPtr
IF (WhichAFList == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//trim(People(Item)%AngleFactorListName)//'", invalid')
CALL ShowSevereError('... Angle Factor List Name not found for PEOPLE= '//TRIM(People(Item)%Name))
ErrorsFound=.true.
ELSEIF(People(Item)%ZonePtr /= AngleFactorList(WhichAFList)%ZonePtr) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(AngleFactorList(WhichAFList)%Name)//' mismatch Zone Name')
CALL ShowContinueError('...Zone="'//trim(AngleFactorList(WhichAFList)%ZoneName)// &
' does not match Zone="'//trim(Zone(People(Item)%ZonePtr)%Name)//'" in PEOPLE="'// &
TRIM(People(Item)%Name)//'".')
ErrorsFound=.true.
END IF
END DO
IF (ErrorsFound) THEN
CALL ShowFatalError('GetAngleFactorList: Program terminated due to preceding errors.')
ENDIF
END SUBROUTINE GetAngleFactorList