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 | ||
---|---|---|---|---|---|---|
type(vector), | intent(in) | :: | UnitVect |
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.
FUNCTION DaylghtAltAndAzimuth (UnitVect) RESULT(DayPos)
! SUBROUTINE INFORMATION:
! AUTHOR Simon Vidanovic
! DATE WRITTEN April 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! Transform unit vector (given in world coordinates) into altitude and azimuth. Azimuth is measured from positive x-axe.
! Altitude range is from -pi/2 to pi/2. Vector laying in horizontal plane will have altitude equal to zero and vector
! pointing upward will have altitude equal to pi/2. Range for azimuth is calculated from -pi to +pi.
! METHODOLOGY EMPLOYED:
! <n/a>
! REFERENCES:
! na
! USE STATEMENTS:
use DataBSDFWindow
use vectors
use DataGlobals
implicit none
type(vector), intent(in) :: UnitVect ! vector which needs to be converted
type(BSDFDaylghtPosition) :: DayPos ! altitude and azimuth in world coordinates
if (UnitVect%x /= 0.0d0) then
if (UnitVect%x >= 0.0d0) then
DayPos%Azimuth = atan(UnitVect%y/UnitVect%x)
else
if (UnitVect%y >= 0.0d0) then
DayPos%Azimuth = pi + atan(UnitVect%y/UnitVect%x)
else
DayPos%Azimuth = -pi + atan(UnitVect%y/UnitVect%x)
end if
end if
else
if (UnitVect%y >= 0.0d0) then
DayPos%Azimuth = PiOvr2
else
DayPos%Azimuth = -PiOvr2
end if
end if
DayPos%Altitude = asin(UnitVect%z)
return
END FUNCTION DaylghtAltAndAzimuth