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 | ||
---|---|---|---|---|---|---|
logical, | intent(inout) | :: | ErrorsFound | |||
integer, | intent(inout) | :: | SurfNum | |||
integer, | intent(in) | :: | TotDetachedFixed | |||
integer, | intent(in) | :: | TotDetachedBldg |
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 GetDetShdSurfaceData(ErrorsFound,SurfNum,TotDetachedFixed,TotDetachedBldg)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN May 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine gets the Detached Shading Surface Data,
! checks it for errors, etc.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! Detached Shading Surface Definition(s)
!Surface:Shading:Detached:Fixed,
! \memo used for shading elements such as trees
! \memo these items are fixed in space and would not move with relative geometry
! A1 , \field User Supplied Surface Name
! \required-field
! \type alpha
! A2, \field TransSchedShadowSurf
! \note Transmittance schedule for the shading device, defaults to zero (always opaque)
! \type object-list
! \object-list ScheduleNames
! N1 , \field Number of Surface Vertex Groups -- Number of (X,Y,Z) groups in this surface
! \required-field
! \note shown with 12 vertex coordinates -- extensible object
! \autocalculatable
! \default autocalculate
! \minimum 3
! \note Rules for vertices are given in SurfaceGeometry coordinates --
! \note For this object all surface coordinates are relative to the building origin (0,0,0)
! \note and will rotate with the BUILDING north axis.
! N2, \field Vertex 1 X-coordinate
! \units m
! \type real
! N3-37; as indicated by the N1 value
!
!Surface:Shading:Detached:Building,
! \memo used for shading elements such as trees, other buildings, parts of this building not being modeled
! \memo these items are relative to the current building and would move with relative geometry
! A1 , \field User Supplied Surface Name
! \required-field
! \type alpha
! A2, \field TransSchedShadowSurf
! \note Transmittance schedule for the shading device, defaults to zero (always opaque)
! \type object-list
! \object-list ScheduleNames
! N1 , \field Number of Surface Vertex Groups -- Number of (X,Y,Z) groups in this surface
! \required-field
! \note shown with 12 vertex coordinates -- extensible object
! \autocalculatable
! \default autocalculate
! \minimum 3
! \note Rules for vertices are given in SurfaceGeometry coordinates --
! \note For this object all surface coordinates are relative to the building origin (0,0,0)
! \note and will rotate with the BUILDING north axis.
! N2, \field Vertex 1 X-coordinate
! \units m
! \type real
! N3-37; as indicated by the N1 value
! USE STATEMENTS:
USE DataIPShortCuts
USE DataReportingFlags
USE InputProcessor, ONLY: GetNumObjectsFound, GetObjectItem, VerifyName, GetObjectDefMaxArgs
USE ScheduleManager, ONLY: GetScheduleIndex,CheckScheduleValueMinMax,GetScheduleMinValue,GetScheduleMaxValue
USE General, ONLY: TrimSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(INOUT) :: ErrorsFound ! Error flag indicator (true if errors found)
INTEGER, INTENT(INOUT) :: SurfNum ! Count of Current SurfaceNumber
INTEGER, INTENT(IN) :: TotDetachedFixed ! Number of Fixed Detached Shading Surfaces to obtain
INTEGER, INTENT(IN) :: TotDetachedBldg ! Number of Building Detached Shading Surfaces to obtain
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER, DIMENSION(2) :: cModuleObjects= &
(/'Shading:Site:Detailed ', &
'Shading:Building:Detailed'/)
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: IOStat ! IO Status when calling get input subroutine
INTEGER :: NumAlphas ! Number of material alpha names being passed
INTEGER :: NumNumbers ! Number of material properties being passed
INTEGER :: Loop
LOGICAL :: ErrorInName
LOGICAL :: IsBlank
INTEGER :: Item
INTEGER :: ItemsToGet
INTEGER :: ClassItem
INTEGER :: numSides
REAL(r64) :: SchedMinValue
REAL(r64) :: SchedMaxValue
IF ((TotDetachedFixed+TotDetachedBldg) > 0 .and. SolarDistribution == MinimalShadowing) THEN
CALL ShowWarningError('Detached shading effects are ignored when Solar Distribution = MinimalShadowing')
ENDIF
IF ((TotDetachedFixed+TotDetachedBldg) == 0) RETURN
DO Item=1,2
cCurrentModuleObject=cModuleObjects(Item)
IF (Item == 1) THEN
ItemsToGet=TotDetachedFixed
ClassItem=SurfaceClass_Detached_F
ELSE !IF (Item == 2) THEN
ItemsToGet=TotDetachedBldg
ClassItem=SurfaceClass_Detached_B
ENDIF
CALL GetObjectDefMaxArgs(cCurrentModuleObject,Loop,NumAlphas,NumNumbers)
IF (NumAlphas /= 2) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': Object Definition indicates'// &
'not = 2 Alpha Objects, Number Indicated='// &
TRIM(TrimSigDigits(NumAlphas)))
ErrorsFound=.true.
ENDIF
DO Loop=1,ItemsToGet
CALL GetObjectItem(cCurrentModuleObject,Loop,cAlphaArgs,NumAlphas, &
rNumericArgs,NumNumbers,IOSTAT, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
ErrorInName=.false.
IsBlank=.false.
CALL VerifyName(cAlphaArgs(1),SurfaceTmp%Name,SurfNum,ErrorInName,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (ErrorInName) THEN
CALL ShowContinueError('...each surface name must not duplicate other surface names (of any type)')
ErrorsFound=.true.
CYCLE
ENDIF
SurfNum=SurfNum+1
SurfaceTmp(SurfNum)%Name = cAlphaArgs(1) ! Set the Surface Name in the Derived Type
SurfaceTmp(SurfNum)%Class=ClassItem
SurfaceTmp(SurfNum)%HeatTransSurf=.false.
! Base transmittance of a shadowing (sub)surface
IF (.not. lAlphaFieldBlanks(2)) THEN
! Schedule for a shadowing (sub)surface
SurfaceTmp(SurfNum)%SchedShadowSurfIndex = GetScheduleIndex(cAlphaArgs(2))
IF (SurfaceTmp(SurfNum)%SchedShadowSurfIndex == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(SurfaceTmp(SurfNum)%Name)// &
'", '//TRIM(cAlphaFieldNames(2))//' not found='//TRIM(cAlphaArgs(2)))
ErrorsFound=.true.
ENDIF
ELSE
SurfaceTmp(SurfNum)%SchedShadowSurfIndex=0
ENDIF
IF (SurfaceTmp(SurfNum)%SchedShadowSurfIndex /= 0) THEN
IF (.not. CheckScheduleValueMinMax(SurfaceTmp(SurfNum)%SchedShadowSurfIndex,'>=',0.0d0,'<=',1.0d0)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(SurfaceTmp(SurfNum)%Name)// &
'", '//TRIM(cAlphaFieldNames(2))//'="'//TRIM(cAlphaArgs(2))// &
'", values not in range [0,1].')
ErrorsFound=.true.
ENDIF
SchedMinValue=GetScheduleMinValue(SurfaceTmp(SurfNum)%SchedShadowSurfIndex)
SurfaceTmp(SurfNum)%SchedMinValue=SchedMinValue
SchedMaxValue=GetScheduleMaxValue(SurfaceTmp(SurfNum)%SchedShadowSurfIndex)
IF (SchedMinValue == 1.0d0) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(SurfaceTmp(SurfNum)%Name)// &
'", '//TRIM(cAlphaFieldNames(2))//'="'//TRIM(cAlphaArgs(2))// &
'", is always transparent.')
SurfaceTmp(SurfNum)%IsTransparent=.true.
ENDIF
IF (SchedMinValue < 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(SurfaceTmp(SurfNum)%Name)// &
'", '//TRIM(cAlphaFieldNames(2))//'="'//TRIM(cAlphaArgs(2))// &
'", has schedule values < 0.')
CALL ShowContinueError('...Schedule values < 0 have no meaning for shading elements.')
ENDIF
IF (SchedMaxValue > 1.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(SurfaceTmp(SurfNum)%Name)// &
'", '//TRIM(cAlphaFieldNames(2))//'="'//TRIM(cAlphaArgs(2))// &
'", has schedule values > 1.')
CALL ShowContinueError('...Schedule values > 1 have no meaning for shading elements.')
ENDIF
IF (ABS(SchedMinValue-SchedMaxValue) > 1.0d-6) THEN
SurfaceTmp(SurfNum)%ShadowSurfSchedVaries=.true.
ShadingTransmittanceVaries=.true.
ENDIF
ENDIF
IF (lNumericFieldBlanks(1) .or. rNumericArgs(1) == AutoCalculate) THEN
numSides=(NumNumbers-1)/3
SurfaceTmp(SurfNum)%Sides=numSides
IF (MOD(NumNumbers-1,3) /= 0) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(SurfaceTmp(SurfNum)%Name)// &
'", '//TRIM(cNumericFieldNames(1))// &
' not even multiple of 3. Will read in '// &
TRIM(TrimSigDigits(SurfaceTmp(SurfNum)%Sides)))
ENDIF
IF (numSides < 3) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(SurfaceTmp(SurfNum)%Name)// &
'", '//TRIM(cNumericFieldNames(1))//' (autocalculate) must be >= 3. Only '// &
TRIM(TrimSigDigits(SurfaceTmp(SurfNum)%Sides))//' provided.')
ErrorsFound=.true.
CYCLE
ENDIF
ELSE
numSides=(NumNumbers-1)/3
SurfaceTmp(SurfNum)%Sides=rNumericArgs(1)
IF (numSides > SurfaceTmp(SurfNum)%Sides) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(SurfaceTmp(SurfNum)%Name)// &
'", field '//TRIM(cNumericFieldNames(1))//'='//TRIM(TrimSigDigits(SurfaceTmp(SurfNum)%Sides)))
CALL ShowContinueError('...but '//TRIM(TrimSigDigits(numSides))//' were entered. Only the indicated '// &
TRIM(cNumericFieldNames(1))//' will be used.')
ENDIF
ENDIF
ALLOCATE(SurfaceTmp(SurfNum)%Vertex(SurfaceTmp(SurfNum)%Sides))
CALL GetVertices(SurfNum,SurfaceTmp(SurfNum)%Sides,rNumericArgs(2:))
CALL CheckConvexity(SurfNum,SurfaceTmp(SurfNum)%Sides)
IF (MakeMirroredDetachedShading) THEN
CALL MakeMirrorSurface(SurfNum)
ENDIF
ENDDO
ENDDO ! Item Loop
RETURN
END SUBROUTINE GetDetShdSurfaceData