Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | CosZen |
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.
REAL(r64) FUNCTION AirMass(CosZen)
! SUBROUTINE INFORMATION:
! AUTHOR C Barnaby
! DATE WRITTEN Nov 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculate relative air mass using Kasten and Young approximation
! METHODOLOGY EMPLOYED:
! Eqn (16), ASHRAE HOF 2009, p. 14.9
! REFERENCES:
! ASHRAE HOF 2009 Chapter 14
! Kasten, F and T. Young. 1989. Revised optical air mass tables
! and approximating formula. Applied Optics 28:4735-4738.
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
REAL(r64), INTENT(IN) :: CosZen ! COS( solar zenith), 0 - 1
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: SunAltD
IF (CosZen <= 0.001d0) THEN
AirMass = 37.07837343d0 ! limit value calc'd with Excel
! value increases little as CosZen -> 0
ELSE IF (CosZen >= 1.d0) THEN
AirMass = 1.d0
ELSE
! note: COS( Zen) = SIN( Alt)
SunAltD = ASIN( CosZen) / DegToRadians ! altitude, degrees
AirMass = 1.d0/(CosZen + 0.50572d0 * (6.07995d0 + SunAltD)**(-1.6364d0))
END IF
END FUNCTION AirMass