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 | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | PVNum |
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 InitTRNSYSPV(PVNum)
! SUBROUTINE INFORMATION:
! AUTHOR David Bradley
! DATE WRITTEN April 2003
! MODIFIED BG March 2007 reworked for CR7109 (reverse DD testing)
! B. Griffith, Aug. 2008 reworked for new, single-PV-generator data structure
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine initializes the PV arrays during simulation. It performs both start of
! simulation initializations and start of timestep initializations. The structure of the
! subroutine was taken from InitBaseboard.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! USE DataPhotovoltaics, ONLY:CellTemp,LastCellTemp
USE DataHeatBalance, ONLY:QRadSWOutIncident
USE DataSurfaces, ONLY: Surface, TotSurfaces
Use DataHVACGlobals, ONLY: SysTimeElapsed, TimeStepSys
USE DataGlobals , ONLY: TimeStep, TimeStepZone, SecInHour, BeginEnvrnFlag, HourOfDay
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: PVNum !the number of the GENERATOR:PHOTOVOLTAICS (passed in)
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL,SAVE :: MyOneTimeFlag = .true.
LOGICAL, ALLOCATABLE,Save, DIMENSION(:) :: MyEnvrnFlag
REAL(r64) :: TimeElapsed ! Fraction of the current hour that has elapsed (h)
! perform the one time initializations
IF (MyOneTimeFlag) THEN
! initialize the environment and sizing flags
ALLOCATE(MyEnvrnFlag(NumPVs))
MyEnvrnFlag = .true.
MyOneTimeFlag = .false.
END IF
! Do the Begin Environment initializations
IF (BeginEnvrnFlag .AND. MyEnvrnFlag(PVNum)) THEN
PVarray(PVNum)%TRNSYSPVcalc%CellTempK = Surface(PVarray(PVNum)%SurfacePtr)%OutDryBulbTemp + KelvinConv
PVarray(PVNum)%TRNSYSPVcalc%LastCellTempK = Surface(PVarray(PVNum)%SurfacePtr)%OutDryBulbTemp + KelvinConv
MyEnvrnFlag(PVNum) = .FALSE.
END IF
IF (.NOT. BeginEnvrnFlag) THEN
MyEnvrnFlag(PVNum) = .TRUE.
END IF
! Do the beginning of every time step initializations
TimeElapsed = HourOfDay + TimeStep * TimeStepZone + SysTimeElapsed
IF (PVarray(PVNum)%TRNSYSPVcalc%TimeElapsed /= TimeElapsed) THEN
! The simulation has advanced to the next system timestep. Save conditions from the end of the previous system
PVarray(PVNum)%TRNSYSPVcalc%LastCellTempK = PVarray(PVNum)%TRNSYSPVcalc%CellTempK
PVarray(PVNum)%TRNSYSPVcalc%TimeElapsed = TimeElapsed
END IF
IF (ANY(QRadSWOutIncident > 0.0D0)) THEN
! Determine the amount of radiation incident on each PV
PVarray(PVNum)%TRNSYSPVcalc%Insolation = QRadSWOutIncident(PVarray(PVNum)%SurfacePtr) ![W/m2]
ELSE
PVarray(PVNum)%TRNSYSPVcalc%Insolation = 0.0D0
ENDIF
RETURN
END SUBROUTINE InitTRNSYSPV