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 CalcWindowProfileAngles
! SUBROUTINE INFORMATION:
! AUTHOR Fred Winkelmann
! DATE WRITTEN April 2002
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Called by CalcPerSolarBeam for wholly or partially sunlit exterior windows
! Calculates horizontal and vertical beam solar profile angles
! REFERENCES: na
! USE STATEMENTS: na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE PARAMETER DEFINITIONS: na
! INTERFACE BLOCK SPECIFICATIONS: na
! DERIVED TYPE DEFINITIONS: na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: SurfNum ! Surface number
REAL(r64) :: ElevSun ! Sun elevation; angle between sun and horizontal
REAL(r64) :: ElevWin ! Window elevation: angle between window outward normal and horizontal
REAL(r64) :: AzimWin ! Window azimuth (radians)
REAL(r64) :: AzimSun ! Sun azimuth (radians)
REAL(r64) :: ProfileAngHor ! Solar profile angle (radians) for horizontally oriented window elements
! such as the top and bottom of a frame.
! This is the incidence angle in a plane that is normal to the window
! and parallel to the Y-axis of the window (the axis along
! which the height of the window is measured).
REAL(r64) :: ProfileAngVert ! Solar profile angle (radians) for vertically oriented elements
! such as the sides of a frame.
! This is the incidence angle in a plane that is normal to the window
! and parallel to the X-axis of the window (the axis along
! which the width of the window is measured).
REAL(r64) :: WinNorm(3) ! Unit vector normal to window
REAL(r64) :: WinNormCrossBase(3) ! Cross product of WinNorm and vector along window baseline
REAL(r64) :: SunPrime(3) ! Projection of sun vector onto plane (perpendicular to
! window plane) determined by WinNorm and vector along
! baseline of window
REAL(r64) :: ThWin ! Azimuth angle of WinNorm (radians)
real(r64) :: dot1,dot2,dot3
ElevSun = Piovr2 - ACOS(SOLCOS(3))
AzimSun = ATAN2(SOLCOS(1),SOLCOS(2))
DO SurfNum = 1,TotSurfaces
IF(Surface(SurfNum)%Class /= SurfaceClass_Window .OR. &
(Surface(SurfNum)%ExtBoundCond /= ExternalEnvironment .AND. &
Surface(SurfNum)%ExtBoundCond /= OtherSideCondModeledExt)) CYCLE
SurfaceWindow(SurfNum)%ProfileAngHor = 0.0d0
SurfaceWindow(SurfNum)%ProfileAngVert = 0.0d0
IF(CosIncAng(SurfNum,HourOfDay,TimeStep) <= 0.0d0) CYCLE
ElevWin = Piovr2 - Surface(SurfNum)%Tilt * DegToRadians
AzimWin = Surface(SurfNum)%Azimuth * DegToRadians
ProfileAngHor = ATAN(SIN(ElevSun)/ABS(COS(ElevSun)*COS(AzimWin-AzimSun))) - ElevWin
!CR9280 - were having negative profile angles on west sides. commenting out previous code (original code) for
! vertical windows
! IF(ABS(ElevWin) < 0.1d0) THEN ! Near-vertical window
! ProfileAngVert = ABS(AzimWin-AzimSun)
! ELSE
WinNorm=Surface(SurfNum)%OutNormVec
ThWin = AzimWin - PiOvr2
WinNormCrossBase(1) = -SIN(ElevWin)*COS(ThWin)
WinNormCrossBase(2) = SIN(ElevWin)*SIN(ThWin)
WinNormCrossBase(3) = COS(ElevWin)
SunPrime = SOLCOS - WinNormCrossBase*DOT_PRODUCT(SOLCOS,WinNormCrossBase)
dot1=DOT_PRODUCT(WinNorm,SunPrime)
dot2=SQRT(DOT_PRODUCT(SunPrime,SunPrime))
dot3=dot1/dot2
if (dot3 > 1.0d0) then
dot3=1.0d0
elseif (dot3 < -1.0d0) then
dot3=-1.0d0
endif
! ProfileAngVert = ABS(ACOS(DOT_PRODUCT(WinNorm,SunPrime)/SQRT(DOT_PRODUCT(SunPrime,SunPrime))))
ProfileAngVert = ABS(ACOS(dot3))
! END IF
! Constrain to 0 to pi
IF(ProfileAngVert > Pi) ProfileAngVert = 2.d0*Pi - ProfileAngVert
SurfaceWindow(SurfNum)%ProfileAngHor = ProfileAngHor/DegToRadians
SurfaceWindow(SurfNum)%ProfileAngVert = ProfileAngVert/DegToRadians
SurfaceWindow(SurfNum)%TanProfileAngHor = ABS(TAN(ProfileAngHor))
SurfaceWindow(SurfNum)%TanProfileAngVert = ABS(TAN(ProfileAngVert))
END DO
RETURN
END SUBROUTINE CalcWindowProfileAngles