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 | ||
---|---|---|---|---|---|---|
logical, | intent(inout) | :: | ErrorsFound |
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 GetEarthTube(ErrorsFound)
! SUBROUTINE INFORMATION:
! AUTHOR Kwang Ho Lee
! DATE WRITTEN November 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine obtains input data for EarthTube units and
! stores it in the EarthTube data structure.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataIPShortCuts
USE InputProcessor, ONLY: GetNumObjectsFound,GetObjectItem,FindItemInList,VerifyName
USE ScheduleManager, ONLY: GetScheduleIndex,GetScheduleValuesForDay
USE General, ONLY: RoundSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(INOUT) :: ErrorsFound ! If errors found in input
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: Blank=' '
REAL(r64), PARAMETER :: EarthTubeTempLimit = 100.d0 ! degrees Celsius
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
!unused1208 CHARACTER(len=MaxNameLength), DIMENSION(10) :: AlphaName
!unused1208 REAL(r64), DIMENSION(20) :: IHGNumbers
INTEGER :: NumAlpha, NumNumber
INTEGER :: IOStat
INTEGER :: Loop
INTEGER :: Loop1
LOGICAL, DIMENSION(:), ALLOCATABLE :: RepVarSet
ALLOCATE(RepVarSet(NumOfZones))
RepVarSet=.true.
! Following used for reporting
ALLOCATE (ZnRptET (NumOfZones))
cCurrentModuleObject='ZoneEarthtube'
TotEarthTube=GetNumObjectsFound(cCurrentModuleObject)
ALLOCATE (EarthTubeSys(TotEarthTube))
DO Loop=1, TotEarthTube
CALL GetObjectItem(cCurrentModuleObject,Loop,cAlphaArgs,NumAlpha,rNumericArgs,NumNumber,IOStat, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
! First Alpha is Zone Name
EarthTubeSys(Loop)%ZonePtr = FindIteminList(cAlphaArgs(1),Zone%Name,NumOfZones)
IF (EarthTubeSys(Loop)%ZonePtr == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(1))//' not found='//TRIM(cAlphaArgs(1)))
ErrorsFound = .TRUE.
ENDIF
! Second Alpha is Schedule Name
EarthTubeSys(Loop)%SchedName = cAlphaArgs(2)
EarthTubeSys(Loop)%SchedPtr = GetScheduleIndex(cAlphaArgs(2))
IF (EarthTubeSys(Loop)%SchedPtr == 0) THEN
IF (lAlphaFieldBlanks(2)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(2))// &
' is required, missing for '//TRIM(cAlphaFieldNames(1))//'='//TRIM(cAlphaArgs(1)))
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': invalid '//TRIM(cAlphaFieldNames(2))// &
' entered='//TRIM(cAlphaArgs(2))// &
' for '//TRIM(cAlphaFieldNames(1))//'='//TRIM(cAlphaArgs(1)))
ENDIF
ErrorsFound = .TRUE.
ENDIF
! Overall parameters and their limits
EarthTubeSys(Loop)%DesignLevel = rNumericArgs(1)
EarthTubeSys(Loop)%MinTemperature = rNumericArgs(2)
IF ((EarthTubeSys(Loop)%MinTemperature < -EarthTubeTempLimit) .OR. &
(EarthTubeSys(Loop)%MinTemperature > EarthTubeTempLimit)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(1))// &
'='//TRIM(cAlphaArgs(1)) // &
' must have a minimum temperature between -'//TRIM(RoundSigDigits(EarthTubeTempLimit,0))// &
'C and '//TRIM(RoundSigDigits(EarthTubeTempLimit,0))//'C')
CALL ShowContinueError('Entered value='//TRIM(RoundSigDigits(EarthTubeSys(Loop)%MinTemperature,0)))
ErrorsFound = .TRUE.
END IF
EarthTubeSys(Loop)%MaxTemperature = rNumericArgs(3)
IF ((EarthTubeSys(Loop)%MaxTemperature < -EarthTubeTempLimit) .OR. &
(EarthTubeSys(Loop)%MaxTemperature > EarthTubeTempLimit)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(1))// &
'='//TRIM(cAlphaArgs(1)) // &
' must have a maximum temperature between -'//TRIM(RoundSigDigits(EarthTubeTempLimit,0))// &
'C and '//TRIM(RoundSigDigits(EarthTubeTempLimit,0))//'C')
CALL ShowContinueError('Entered value='//TRIM(RoundSigDigits(EarthTubeSys(Loop)%MaxTemperature,0)))
ErrorsFound = .TRUE.
END IF
EarthTubeSys(Loop)%DelTemperature = rNumericArgs(4) ! 3/12/03 Negative del temp now allowed COP
SELECT CASE (cAlphaArgs(3)) ! Fan type character input-->convert to integer
CASE ('EXHAUST')
EarthTubeSys(Loop)%FanType = ExhaustEarthTube
CASE ('INTAKE')
EarthTubeSys(Loop)%FanType = IntakeEarthTube
CASE ('NATURAL','NONE',Blank)
EarthTubeSys(Loop)%FanType = NaturalEarthTube
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(1))// &
'='//TRIM(cAlphaArgs(1)) // &
', '//TRIM(cAlphaFieldNames(3))//' invalid='//TRIM(cAlphaArgs(3)))
ErrorsFound = .TRUE.
END SELECT
EarthTubeSys(Loop)%FanPressure = rNumericArgs(5)
IF (EarthTubeSys(Loop)%FanPressure < 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(1))// &
'='//TRIM(cAlphaArgs(1)) // &
', '//TRIM(cNumericFieldNames(5))//' must be positive, entered value='// &
TRIM(RoundSigDigits(EarthTubeSys(Loop)%FanPressure,2)))
ErrorsFound = .TRUE.
END IF
EarthTubeSys(Loop)%FanEfficiency = rNumericArgs(6)
IF ((EarthTubeSys(Loop)%FanEfficiency <= 0.0d0) .OR. &
(EarthTubeSys(Loop)%FanEfficiency > 1.0d0)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(1))// &
'='//TRIM(cAlphaArgs(1)) // &
', '//TRIM(cNumericFieldNames(6))//' must be greater than zero and less than or equal to one, entered value='// &
TRIM(RoundSigDigits(EarthTubeSys(Loop)%FanEfficiency,2)))
ErrorsFound = .TRUE.
END IF
EarthTubeSys(Loop)%r1 = rNumericArgs(7)
IF (EarthTubeSys(Loop)%r1 <= 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(1))// &
'='//TRIM(cAlphaArgs(1)) // &
', '//TRIM(cNumericFieldNames(7))//' must be positive, entered value='// &
TRIM(RoundSigDigits(EarthTubeSys(Loop)%r1,2)))
ErrorsFound = .TRUE.
END IF
EarthTubeSys(Loop)%r2 = rNumericArgs(8)
IF (EarthTubeSys(Loop)%r2 <= 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(1))// &
'='//TRIM(cAlphaArgs(1)) // &
', '//TRIM(cNumericFieldNames(8))//' must be positive, entered value='// &
TRIM(RoundSigDigits(EarthTubeSys(Loop)%r2,2)))
ErrorsFound = .TRUE.
END IF
EarthTubeSys(Loop)%r3 = 2.d0*EarthTubeSys(Loop)%r1
EarthTubeSys(Loop)%PipeLength = rNumericArgs(9)
IF (EarthTubeSys(Loop)%PipeLength <= 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(1))// &
'='//TRIM(cAlphaArgs(1)) // &
', '//TRIM(cNumericFieldNames(9))//' must be positive, entered value='// &
TRIM(RoundSigDigits(EarthTubeSys(Loop)%PipeLength,2)))
ErrorsFound = .TRUE.
END IF
EarthTubeSys(Loop)%PipeThermCond = rNumericArgs(10)
IF (EarthTubeSys(Loop)%PipeThermCond <= 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(1))// &
'='//TRIM(cAlphaArgs(1)) // &
', '//TRIM(cNumericFieldNames(10))//' must be positive, entered value='// &
TRIM(RoundSigDigits(EarthTubeSys(Loop)%PipeThermCond,2)))
ErrorsFound = .TRUE.
END IF
EarthTubeSys(Loop)%z = rNumericArgs(11)
IF (EarthTubeSys(Loop)%z <= 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(1))// &
'='//TRIM(cAlphaArgs(1)) // &
', '//TRIM(cNumericFieldNames(11))//' must be positive, entered value='// &
TRIM(RoundSigDigits(EarthTubeSys(Loop)%z,2)))
ErrorsFound = .TRUE.
END IF
IF (EarthTubeSys(Loop)%z <= (EarthTubeSys(Loop)%r1+EarthTubeSys(Loop)%r2+EarthTubeSys(Loop)%r3)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(1))// &
'='//TRIM(cAlphaArgs(1)) // &
', '//TRIM(cNumericFieldNames(11))//' must be greater than 3*'// &
TRIM(cNumericFieldNames(7))//' + '//TRIM(cNumericFieldNames(8))//' entered value='// &
TRIM(RoundSigDigits(EarthTubeSys(Loop)%z,2))//' ref sum='// &
TRIM(RoundSigDigits(EarthTubeSys(Loop)%r1+EarthTubeSys(Loop)%r2+EarthTubeSys(Loop)%r3,2)))
ErrorsFound = .TRUE.
END IF
SELECT CASE (cAlphaArgs(4)) ! Soil type character input --> convert to number
CASE ('HEAVYANDSATURATED')
EarthTubeSys(Loop)%SoilThermDiff = 0.0781056d0
EarthTubeSys(Loop)%SoilThermCond = 2.42d0
CASE ('HEAVYANDDAMP')
EarthTubeSys(Loop)%SoilThermDiff = 0.055728d0
EarthTubeSys(Loop)%SoilThermCond = 1.3d0
CASE ('HEAVYANDDRY')
EarthTubeSys(Loop)%SoilThermDiff = 0.0445824d0
EarthTubeSys(Loop)%SoilThermCond = 0.865d0
CASE ('LIGHTANDDRY')
EarthTubeSys(Loop)%SoilThermDiff = 0.024192d0
EarthTubeSys(Loop)%SoilThermCond = 0.346d0
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(cAlphaFieldNames(1))// &
'='//TRIM(cAlphaArgs(1)) // &
', '//TRIM(cAlphaFieldNames(4))//' invalid='//TRIM(cAlphaArgs(4)))
ErrorsFound = .TRUE.
END SELECT
EarthTubeSys(Loop)%AverSoilSurTemp = rNumericArgs(12)
EarthTubeSys(Loop)%ApmlSoilSurTemp = rNumericArgs(13)
EarthTubeSys(Loop)%SoilSurPhaseConst = INT(rNumericArgs(14))
! Override any user input for cases where natural ventilation is being used
IF (EarthTubeSys(Loop)%FanType == NaturalEarthTube) THEN
EarthTubeSys(Loop)%FanPressure = 0.0d0
EarthTubeSys(Loop)%FanEfficiency = 1.0d0
END IF
EarthTubeSys(Loop)%ConstantTermCoef = rNumericArgs(15)
EarthTubeSys(Loop)%TemperatureTermCoef = rNumericArgs(16)
EarthTubeSys(Loop)%VelocityTermCoef = rNumericArgs(17)
EarthTubeSys(Loop)%VelocitySQTermCoef = rNumericArgs(18)
IF (EarthTubeSys(Loop)%ZonePtr > 0) THEN
IF (RepVarSet(EarthTubeSys(Loop)%ZonePtr)) THEN
RepVarSet(EarthTubeSys(Loop)%ZonePtr)=.false.
CALL SetupOutputVariable('Earth Tube Zone Sensible Cooling Energy [J]', &
ZnRptET(EarthTubeSys(Loop)%ZonePtr)%EarthTubeHeatLoss, &
'System','NonState',Zone(EarthTubeSys(Loop)%ZonePtr)%Name)
CALL SetupOutputVariable('Earth Tube Zone Sensible Cooling Rate [W]', &
ZnRptET(EarthTubeSys(Loop)%ZonePtr)%EarthTubeHeatLossRate, &
'System','State',Zone(EarthTubeSys(Loop)%ZonePtr)%Name)
CALL SetupOutputVariable('Earth Tube Zone Sensible Heating Energy [J]', &
ZnRptET(EarthTubeSys(Loop)%ZonePtr)%EarthTubeHeatGain, &
'System','NonState',Zone(EarthTubeSys(Loop)%ZonePtr)%Name)
CALL SetupOutputVariable('Earth Tube Zone Sensible Heating Rate [W]', &
ZnRptET(EarthTubeSys(Loop)%ZonePtr)%EarthTubeHeatGainRate, &
'System','State',Zone(EarthTubeSys(Loop)%ZonePtr)%Name)
CALL SetupOutputVariable('Earth Tube Air Flow Volume [m3]', &
ZnRptET(EarthTubeSys(Loop)%ZonePtr)%EarthTubeVolume, &
'System','NonState',Zone(EarthTubeSys(Loop)%ZonePtr)%Name)
CALL SetupOutputVariable('Earth Tube Air Volume Flow Rate [m3/s]', &
ZnRptET(EarthTubeSys(Loop)%ZonePtr)%EarthTubeVolFlowRate, &
'System','State',Zone(EarthTubeSys(Loop)%ZonePtr)%Name)
CALL SetupOutputVariable('Earth Tube Air Flow Mass [kg]', &
ZnRptET(EarthTubeSys(Loop)%ZonePtr)%EarthTubeMass, &
'System','NonState',Zone(EarthTubeSys(Loop)%ZonePtr)%Name)
CALL SetupOutputVariable('Earth Tube Air Mass Flow Rate [kg/s]', &
ZnRptET(EarthTubeSys(Loop)%ZonePtr)%EarthTubeMassFlowRate, &
'System','State',Zone(EarthTubeSys(Loop)%ZonePtr)%Name)
CALL SetupOutputVariable('Earth Tube Fan Electric Energy [J]', &
ZnRptET(EarthTubeSys(Loop)%ZonePtr)%EarthTubeFanElec, &
'System','NonState',Zone(EarthTubeSys(Loop)%ZonePtr)%Name, &
ResourceTypeKey='Electricity',GroupKey='Building')
CALL SetupOutputVariable('Earth Tube Fan Electric Power [W]', &
ZnRptET(EarthTubeSys(Loop)%ZonePtr)%EarthTubeFanElecPower, &
'System','State',Zone(EarthTubeSys(Loop)%ZonePtr)%Name)
CALL SetupOutputVariable('Earth Tube Zone Inlet Air Temperature [C]', &
ZnRptET(EarthTubeSys(Loop)%ZonePtr)%EarthTubeAirTemp, &
'System','State',Zone(EarthTubeSys(Loop)%ZonePtr)%Name)
CALL SetupOutputVariable('Earth Tube Ground Interface Temperature [C]', &
EarthTubeSys(Loop)%GroundTempz1z2t, &
'System','State',Zone(EarthTubeSys(Loop)%ZonePtr)%Name)
CALL SetupOutputVariable('Earth Tube Outdoor Air Heat Transfer Rate [W]', &
ZnRptET(EarthTubeSys(Loop)%ZonePtr)%EarthTubeOATreatmentPower, &
'System','State',Zone(EarthTubeSys(Loop)%ZonePtr)%Name)
END IF
END IF
END DO
! Check to make sure there is only on ventilation statement per zone
DO Loop = 1, TotEarthTube
DO Loop1 = Loop+1, TotEarthTube-1
IF (EarthTubeSys(Loop)%ZonePtr == EarthTubeSys(Loop1)%ZonePtr) THEN
CALL ShowSevereError(TRIM(cAlphaArgs(1))//' is assigned to more than one '//TRIM(cCurrentModuleObject))
CALL ShowContinueError('Only one such assignment is allowed.')
ErrorsFound = .TRUE.
END IF
END DO
END DO
IF (ErrorsFound) THEN
CALL ShowFatalError(TRIM(cCurrentModuleObject)//': Errors getting input. Program terminates.')
ENDIF
END SUBROUTINE GetEarthTube