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) | :: | GeneratorType | |||
character(len=*), | intent(in) | :: | GeneratorName | |||
integer, | intent(inout) | :: | GeneratorIndex | |||
logical, | intent(in) | :: | RunFlag | |||
real(kind=r64), | intent(in) | :: | PVLoad |
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 SimPVGenerator(GeneratorType,GeneratorName,GeneratorIndex,RunFlag,PVLoad)
! SUBROUTINE INFORMATION:
! AUTHOR David Bradley
! DATE WRITTEN April 2003
! MODIFIED B. Griffith Jan 2004
! B. Griffith Aug. 2008 Rework for new structure
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is in charge of all the rest of the subroutines contained
! in this module. provides common entry point for all the models
! METHODOLOGY EMPLOYED:
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList
!unused0909 USE DataEnvironment, ONLY : EnvironmentName, DayOfYear
!unused0909 USE DataGlobals, ONLY: BeginEnvrnFlag, EndEnvrnFlag
USE DataGlobalConstants, ONLY: iGeneratorPV
USE General, ONLY: TrimSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: GeneratorType ! type of Generator !unused1208
CHARACTER(len=*), INTENT(IN) :: GeneratorName ! user specified name of Generator
INTEGER, INTENT(INOUT) :: GeneratorIndex
LOGICAL , INTENT(IN) :: RunFlag ! is PV ON or OFF as determined by schedules in ElecLoadCenter
REAL(r64) , INTENT(IN) :: PVLoad ! electrical load on the PV (not really used... PV models assume "full on" !unused1208
! SUBROUTINE PARAMETER DEFINITIONS:
! na)
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: PVNum ! index of unit in PV array for Equivalent one-diode model
LOGICAL,SAVE :: GetInputFlag = .TRUE. ! one time get input flag
!Get PV data from input file
IF (GetInputFlag) THEN
CALL GetPVInput ! for all three types of models
GetInputFlag=.FALSE.
ENDIF
IF (GeneratorIndex == 0) THEN
PVNum = FindItemInList(GeneratorName, PVarray%Name, NumPVs)
IF (PVNum == 0) THEN
CALL ShowFatalError('SimPhotovoltaicGenerator: Specified PV not one of valid Photovoltaic Generators '// &
TRIM(GeneratorName))
ENDIF
GeneratorIndex=PVNum
ELSE
PVNum = GeneratorIndex
IF (PVNum > NumPVs .or. PVNum < 1) THEN
CALL ShowFatalError('SimPhotovoltaicGenerator: Invalid GeneratorIndex passed='//TRIM(TrimSigDigits(PVNum))// &
', Number of PVs='//TRIM(TrimSigDigits(NumPVs))// &
', Generator name='//TRIM(GeneratorName))
ENDIF
IF (CheckEquipName(PVNum)) THEN
IF (GeneratorName /= PVarray(PVNum)%Name) THEN
CALL ShowFatalError('SimPhotovoltaicGenerator: Invalid GeneratorIndex passed='//TRIM(TrimSigDigits(PVNum))// &
', Generator name='//TRIM(GeneratorName)//', stored PV Name for that index='// &
TRIM(PVarray(PVNum)%Name))
ENDIF
CheckEquipName(PVNum)=.false.
ENDIF
ENDIF
SELECT CASE (PVarray(PVNum)%PVModelType) !SELECT and CALL MODELS based on model type
CASE (iSimplePVModel) !
CALL CalcSimplePV(PVNum, RunFlag)
CASE (iTRNSYSPVModel)
! 'PhotovoltaicPeformance:EquivalentOne-Diode' (aka. 5-parameter TRNSYS type 180 model)
CALL InitTRNSYSPV(PVNum)
CALL CalcTRNSYSPV(PVNum,RunFlag)
CASE (iSandiaPVModel)
! 'PhotovoltaicPerformance:Sandia' (aka. King model, Sandia Nat. Labs. )
CALL CalcSandiaPV(PVNum, RunFlag)
CASE DEFAULT
CALL ShowFatalError('Specified generator model type not found for PV generator = '//TRIM(GeneratorName))
END SELECT
CALL ReportPV(PVNum)
RETURN
END SUBROUTINE SimPVGenerator