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 SetupInterpolationValues
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN November 2002
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine creates the "interpolation" values / weights that are used for
! interpolating weather data from hourly down to the time step level.
! METHODOLOGY EMPLOYED:
! Create arrays (InterpolationValues, SolarInterpolationValues) dependent on
! Number of Time Steps in Hour. This will be used in the "SetCurrentWeather" procedure.
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER halfpoint
INTEGER hpoint
INTEGER tloop
REAL(r64) tweight
REAL(r64) tweight1
ALLOCATE(Interpolation(NumOfTimeStepInHour))
ALLOCATE(SolarInterpolation(NumOfTimeStepInHour))
Interpolation=0.0d0
SolarInterpolation=0.0d0
halfpoint=0
do tloop=1,NumOfTimeStepInHour
IF (NumOfTimeStepInHour == 1) THEN
tweight=1.0d0
ELSE
tweight = MIN(1.0d0,(REAL(tloop,r64)/REAL(NumOfTimeStepInHour,r64)))
END IF
Interpolation(tloop)=tweight
enddo
if (mod(NumOfTimeStepInHour,2) == 0) then
! even number of time steps.
halfpoint=NumOfTimeStepInHour/2
SolarInterpolation(halfpoint)=1.0d0
tweight=1.d0/REAL(NumOfTimeStepInHour,r64)
hpoint=1
do tloop=halfpoint+1,NumOfTimeStepInHour
SolarInterpolation(tloop)=1.0-hpoint*tweight
hpoint=hpoint+1
enddo
hpoint=1
do tloop=halfpoint-1,1,-1
SolarInterpolation(tloop)=1.0-hpoint*tweight
hpoint=hpoint+1
enddo
else ! odd number of time steps
if (NumOfTimeStepInHour == 1) then
SolarInterpolation(1)=.5d0
elseif (NumOfTimeStepInHour == 3) then
tweight=1.d0/real(NumOfTimeStepInHour,r64)
SolarInterpolation(1)=5.0d0/6.0d0
SolarInterpolation(2)=5.0d0/6.0d0
SolarInterpolation(3)=.5d0
else
tweight=1.d0/real(NumOfTimeStepInHour,r64)
halfpoint=NumOfTimeStepInHour/2
tweight1=1.0d0-tweight/2.d0
SolarInterpolation(halfpoint)=tweight1
SolarInterpolation(halfpoint+1)=tweight1
hpoint=1
do tloop=halfpoint+2,NumOfTimeStepInHour
SolarInterpolation(tloop)=tweight1-hpoint*tweight
hpoint=hpoint+1
enddo
hpoint=1
do tloop=halfpoint-1,1,-1
SolarInterpolation(tloop)=tweight1-hpoint*tweight
hpoint=hpoint+1
enddo
endif
endif
RETURN
END SUBROUTINE SetupInterpolationValues