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.
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 GetGeneratorFuelSupplyInput
! SUBROUTINE INFORMATION:
! AUTHOR B Griffith
! DATE WRITTEN July 2006,
! MODIFIED na
! RE-ENGINEERED this module extracted from older SOFC module for
! reuse with both Annex 42 models,
! PURPOSE OF THIS SUBROUTINE:
! <description>
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: GetNumObjectsFound, VerifyName, GetObjectItem, SameString ! might also use FindItemInList
USE DataIPShortCuts
USE NodeInputManager, ONLY: GetOnlySingleNode
USE CurveManager, ONLY: GetCurveIndex
USE ScheduleManager, ONLY: GetScheduleIndex
USE DataLoopNode, ONLY: NodeConnectionType_Sensor, NodeType_Air, ObjectIsNotParent
USE General, ONLY: RoundSigDigits
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 :: GeneratorNum !Generator counter
INTEGER :: NumAlphas ! Number of elements in the alpha array
INTEGER :: NumNums ! Number of elements in the numeric array
INTEGER :: IOStat ! IO Status when calling get input subroutine
CHARACTER(len=MaxNameLength),DIMENSION(25) :: AlphArray !character string data
REAL(r64), DIMENSION(200) :: NumArray !numeric data TODO deal with allocatable for extensible
LOGICAL, SAVE :: ErrorsFound=.false. ! error flag
LOGICAL :: IsNotOK ! Flag to verify name
LOGICAL :: IsBlank ! Flag for blank name
INTEGER :: FuelSupNum !
LOGICAL, SAVE :: MyOneTimeFlag = .true. !
CHARACTER(len=MaxNameLength) :: ObjMSGName
INTEGER :: ConstitNum
IF (MyOneTimeFlag) then
cCurrentModuleObject = 'Generator:FuelSupply'
NumGeneratorFuelSups = GetNumObjectsFound(cCurrentModuleObject)
IF (NumGeneratorFuelSups <= 0) THEN
CALL ShowSevereError('No '//TRIM(cCurrentModuleObject)//' equipment specified in input file')
ErrorsFound=.true.
ENDIF
Allocate(FuelSupply(NumGeneratorFuelSups))
DO FuelSupNum = 1 , NumGeneratorFuelSups
CALL GetObjectItem(cCurrentModuleObject,FuelSupNum,AlphArray,NumAlphas, &
NumArray,NumNums,IOSTAT, AlphaFieldnames=cAlphaFieldNames, &
NumericFieldNames=cNumericFieldNames)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(AlphArray(1),FuelSupply%Name,FuelSupNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) AlphArray(1)='xxxxx'
ENDIF
FuelSupply(FuelSupNum)%Name = AlphArray(1)
ObjMSGName =TRIM(cCurrentModuleObject)//' Named '//trim(AlphArray(1))
IF(SameString('TemperatureFromAirNode', AlphArray(2))) THEN
FuelSupply(FuelSupNum)%FuelTempMode = FuelInTempFromNode
ELSEIF (SameString('Scheduled', AlphArray(2))) THEN
FuelSupply(FuelSupNum)%FuelTempMode = FuelInTempSchedule
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(AlphArray(2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
errorsFound = .true.
ENDIF
FuelSupply(FuelSupNum)%NodeName = AlphArray(3)
FuelSupply(FuelSupNum)%NodeNum = &
GetOnlySingleNode(AlphArray(3),ErrorsFound,TRIM(cCurrentModuleObject),AlphArray(1), &
NodeType_Air,NodeConnectionType_Sensor,1,ObjectIsNotParent)
FuelSupply(FuelSupNum)%SchedNum = GetScheduleIndex(AlphArray(4))
IF ((FuelSupply(FuelSupNum)%SchedNum == 0) .AND. &
(FuelSupply(FuelSupNum)%FuelTempMode == FuelInTempSchedule)) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(4))//' = '//TRIM(AlphArray(4)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
CAll ShowContinueError('Schedule named was not found')
errorsFound = .true.
ENDIF
FuelSupply(FuelSupNum)%CompPowerCurveID = GetCurveIndex(AlphArray(5))
IF (FuelSupply(FuelSupNum)%CompPowerCurveID == 0 ) then
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(5))//' = '//TRIM(AlphArray(5)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
Call ShowContinueError('Curve named was not found ' )
errorsFound = .true.
ENDIF
FuelSupply%CompPowerLossFactor = NumArray(1)
IF (SameString(AlphArray(6), 'GaseousConstituents')) THEN
FuelSupply(FuelSupNum)%FuelTypeMode = fuelModeGaseousConstituents
ELSEIF (samestring(AlphArray(6), 'LiquidGeneric')) THEN
FuelSupply(FuelSupNum)%FuelTypeMode = fuelModeGenericLiquid
ELSE
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(6))//' = '//TRIM(AlphArray(6)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(AlphArray(1)))
ErrorsFound = .TRUE.
ENDIF
FuelSupply(FuelSupNum)%LHVliquid = NumArray(2)*1000.0d0 !generic liquid LHV (kJ/kG input converted to J/kG )
FuelSupply(FuelSupNum)%HHV = NumArray(3)*1000.0d0 !generic liquid HHV (kJ/kG input converted to J/kG )
FuelSupply(FuelSupNum)%MW = NumArray(4) !
FuelSupply(FuelSupNum)%eCO2 = NumArray(5) !
IF (FuelSupply(FuelSupNum)%FuelTypeMode == fuelModeGaseousConstituents) then
NumFuelConstit = NumArray(6)
FuelSupply(FuelSupNum)%NumConstituents = NumFuelConstit
IF (NumFuelConstit > 12) THEN
CALL showSevereError(TRIM(cCurrentModuleObject)//' model not set up for more than 12 fuel constituents')
errorsfound = .true.
ENDIF
If (NumFuelConstit < 1) THEN
CALL showSevereError(TRIM(cCurrentModuleObject)//' model needs at least one fuel constituent')
errorsfound = .true.
ENDIF
DO ConstitNum=1, NumFuelConstit
FuelSupply(FuelSupNum)%ConstitName(ConstitNum) = AlphArray(ConstitNum + 6)
FuelSupply(FuelSupNum)%ConstitMolalFract(ConstitNum) = NumArray(ConstitNum + 6)
ENDDO
! check for molar fractions summing to 1.0.
IF (ABS(SUM(FuelSupply(FuelSupNum)%ConstitMolalFract)-1.0d0) > .0001d0) THEN
CALL showSevereError(TRIM(cCurrentModuleObject)//' molar fractions do not sum to 1.0')
CALL ShowContinueError('Sum was='//TRIM(RoundSigDigits(SUM(FuelSupply(FuelSupNum)%ConstitMolalFract),5)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(AlphArray(1)))
errorsfound = .true.
ENDIF
ENDIF
ENDDO
!now make calls to Setup
DO FuelSupNum = 1 , NumGeneratorFuelSups
CAll SetupFuelConstituentData(FuelSupNum, ErrorsFound)
ENDDO
IF (ErrorsFound) THEN
CALL ShowFatalError('Problem found processing input for '//TRIM(cCurrentModuleObject) )
ENDIF
MyOneTimeFlag = .FALSE.
ENDIF ! MyOneTimeFlag
RETURN
END SUBROUTINE GetGeneratorFuelSupplyInput