SUBROUTINE GetDesignDayData(TotDesDays,ErrorsFound)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Liesen
! DATE WRITTEN September 1997
! MODIFIED
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine retrieves the design day info from user input file
! which is later to be used in the Setup Design Day Routine.
! METHODOLOGY EMPLOYED:
!
! REFERENCES:
! SizingPeriod:DesignDay,
! A1, \field Name
! N1, \field Month
! N2, \field Day of Month
! A2, \field Day Type
! N3, \field Maximum Dry-Bulb Temperature
! N4, \field Daily Dry-Bulb Temperature Range
! A3, \field Dry-Bulb Temperature Range Modifier Type
! A4, \field Dry-Bulb Temperature Range Modifier Day Schedule Name
! A5, \field Humidity Condition Type
! N5, \field Wetbulb or DewPoint at Maximum Dry-Bulb
! A6, \field Humidity Condition Day Schedule Name
! N6, \field Humidity Ratio at Maximum Dry-Bulb
! N7, \field Enthalpy at Maximum Dry-Bulb !will require units transition.
! N8, \field Daily Wet-Bulb Temperature Range
! N9, \field Barometric Pressure
! N10, \field Wind Speed
! N11, \field Wind Direction
! A7, \field Rain Indicator
! A8, \field Snow Indicator
! A9, \field Daylight Saving Time Indicator
! A10, \field Solar Model Indicator
! A11, \field Beam Solar Day Schedule Name
! A12, \field Diffuse Solar Day Schedule Name
! N12, \field ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub)
! N13, \field ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud)
! N14; \field Sky Clearness
! USE STATEMENTS:
USE DataIPShortCuts
USE InputProcessor, ONLY: FindItemInList, GetObjectItem, VerifyName, RangeCheck, SameString
USE General, ONLY: RoundSigDigits, FindNumberInList
USE ScheduleManager, ONLY: GetDayScheduleIndex, GetSingleDayScheduleValues, CheckDayScheduleValueMinMax
USE DataSystemVariables
USE OutputReportPredefined
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
Integer :: TotDesDays ! Total number of Design days to Setup
LOGICAL, INTENT(INOUT) :: ErrorsFound
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER, DIMENSION(12) :: ValidNames=(/'SUNDAY ','MONDAY ','TUESDAY ', &
'WEDNESDAY ','THURSDAY ','FRIDAY ', &
'SATURDAY ','HOLIDAY ','SUMMERDESIGNDAY', &
'WINTERDESIGNDAY','CUSTOMDAY1 ','CUSTOMDAY2 '/)
CHARACTER(len=*), PARAMETER, DIMENSION(0:DDHumIndType_Count-1) :: HumidityIndicatingType= &
(/'Wetbulb [C] ', &
'Dewpoint [C] ', &
'Enthalpy [J/kg] ', &
'Humidity Ratio [] ', &
'Schedule [] ', &
'WetBulbProfileDefaultMultipliers []', &
'WetBulbProfileDifferenceSchedule []', &
'WetBulbProfileMultiplierSchedule []'/)
! REAL(r64), PARAMETER, DIMENSION(24) :: DefaultTempRangeMult=(/ .87d0,.92d0,.96d0,.99d0,1.0d0,.98d0,.93d0, &
! .84d0,.71d0,.56d0,.39d0,.23d0, .11d0,.03d0,.00d0,.03d0,.10d0,.21d0,.34d0,.47d0,.58d0,.68d0,.76d0,.82d0 /)
! Below are the 2009 fractions, HOF, Chap 14, Table 6
REAL(r64), PARAMETER, DIMENSION(24) :: DefaultTempRangeMult=(/ .88d0,.92d0,.95d0,.98d0,1.0d0,.98d0,.91d0, &
.74d0,.55d0,.38d0,.23d0,.13d0, .05d0,0.00d0,0.00d0,.06d0,.14d0,.24d0,.39d0,.50d0,.59d0,.68d0,.75d0,.82d0 /)
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Integer :: EnvrnNum ! Environment Loop to pass to Design Day Setup Routine
INTEGER :: NumAlpha ! Number of material alpha names being passed
INTEGER :: NumNumerics ! Number of material properties being passed
INTEGER :: IOStat ! IO Status when calling get input subroutine
LOGICAL :: IsNotOK ! Flag to verify name
LOGICAL :: IsBlank ! Flag for blank name
INTEGER :: HrLoop
INTEGER :: TSLoop
REAL(r64) LastHrValue
REAL(r64) WNow
REAL(r64) WPrev
REAL(r64) testval
LOGICAL errflag
INTEGER DDLoop
CHARACTER(len=MaxNameLength) :: envTitle
CHARACTER(len=15) :: units
INTEGER :: schPtr
LOGICAL :: MaxDryBulbEntered
LOGICAL :: PressureEntered
! FLOW:
ALLOCATE (DesDayInput(TotDesDays))! Allocate the array to the # of DD's
ALLOCATE (DDDBRngModifier(TotDesDays,24,NumOfTimeStepInHour))
DDDBRngModifier=0.0d0
ALLOCATE (DDHumIndModifier(TotDesDays,24,NumOfTimeStepInHour))
DDHumIndModifier=0.0d0
ALLOCATE (DDBeamSolarValues(TotDesDays,24,NumOfTimeStepInHour))
DDBeamSolarValues=0.0d0
ALLOCATE (DDDiffuseSolarValues(TotDesDays,24,NumOfTimeStepInHour))
DDDiffuseSolarValues=0.0d0
ALLOCATE (DDSkyTempScheduleValues(TotDesDays,24,NumOfTimeStepInHour))
DDSkyTempScheduleValues=0.0d0
ALLOCATE(SPSiteDryBulbRangeModScheduleValue(TotDesDays))
SPSiteDryBulbRangeModScheduleValue = 0.0d0
ALLOCATE(SPSiteHumidityConditionScheduleValue(TotDesDays))
SPSiteHumidityConditionScheduleValue = 0.0d0
ALLOCATE(SPSiteBeamSolarScheduleValue(TotDesDays))
SPSiteBeamSolarScheduleValue = 0.0d0
ALLOCATE(SPSiteDiffuseSolarScheduleValue(TotDesDays))
SPSiteDiffuseSolarScheduleValue = 0.0d0
ALLOCATE(SPSiteSkyTemperatureScheduleValue(TotDesDays))
SPSiteSkyTemperatureScheduleValue = 0.0d0
IF (ReverseDD .and. TotDesDays <=1) THEN
CALL ShowSevereError('GetDesignDayData: Reverse Design Day requested but # Design Days <=1')
ENDIF
cCurrentModuleObject='SizingPeriod:DesignDay'
Do DDLoop = 1,TotDesDays
IF (ReverseDD) THEN
IF (DDLoop == 1 .and. TotDesDays > 1) THEN
EnvrnNum=2
ELSEIF (DDLoop == 2) THEN
EnvrnNum=1
ELSE
EnvrnNum=DDLoop
ENDIF
ELSE
EnvrnNum=DDLoop
ENDIF
!Call Input Get routine to retrieve design day data
MaxDryBulbEntered=.false.
PressureEntered=.false.
CALL GetObjectItem(cCurrentModuleObject,DDLoop,cAlphaArgs,NumAlpha,rNumericArgs,NumNumerics,IOSTAT, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
! A1, \field Name
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(cAlphaArgs(1),DesDayInput%Title,EnvrnNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
DesDayInput(EnvrnNum)%Title = cAlphaArgs(1) ! Environment name
Environment(EnvrnNum)%Title = DesDayInput(EnvrnNum)%Title
! N3, \field Maximum Dry-Bulb Temperature
! N4, \field Daily Dry-Bulb Temperature Range
! N9, \field Barometric Pressure
! N10, \field Wind Speed
! N11, \field Wind Direction
DesDayInput(EnvrnNum)%MaxDryBulb = rNumericArgs(3) ! Maximum Dry-Bulb Temperature (C)
IF (.not. lNumericFieldBlanks(3)) MaxDryBulbEntered=.true.
DesDayInput(EnvrnNum)%DailyDBRange = rNumericArgs(4) ! Daily dry-bulb temperature range (deltaC)
DesDayInput(EnvrnNum)%PressBarom = rNumericArgs(9) ! Atmospheric/Barometric Pressure (Pascals)
IF (.not. lNumericFieldBlanks(9)) PressureEntered=.true.
DesDayInput(EnvrnNum)%PressureEntered=PressureEntered
DesDayInput(EnvrnNum)%WindSpeed = rNumericArgs(10) ! Wind Speed (m/s)
DesDayInput(EnvrnNum)%WindDir = MOD(rNumericArgs(11),360.d0)! Wind Direction
! (degrees clockwise from North, N=0, E=90, S=180, W=270)
! N1, \field Month
! N2, \field Day of Month
! N12, \field ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub)
! N13, \field ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud)
! N8, \field Daily Wet-Bulb Temperature Range
DesDayInput(EnvrnNum)%Month=Int(rNumericArgs(1)) ! Month of Year ( 1 - 12 )
DesDayInput(EnvrnNum)%DayOfMonth=Int(rNumericArgs(2)) ! Day of Month ( 1 - 31 )
DesDayInput(EnvrnNum)%TauB=rNumericArgs(12) ! beam tau >= 0
DesDayInput(EnvrnNum)%TauD=rNumericArgs(13) ! diffuse tau >= 0
DesDayInput(EnvrnNum)%DailyWBRange=rNumericArgs(8) ! Daily wet-bulb temperature range (deltaC)
! N14; \field Sky Clearness
DesDayInput(EnvrnNum)%SkyClear = rNumericArgs(14) ! Sky Clearness (0 to 1)
! A7, \field Rain Indicator
IF (SameString(cAlphaArgs(7),'Yes') .or. SameString(cAlphaArgs(7),'1') ) THEN
DesDayInput(EnvrnNum)%RainInd=1
ELSEIF (SameString(cAlphaArgs(7),'No') .or. SameString(cAlphaArgs(7),'0') .or. lAlphaFieldBlanks(7)) THEN
DesDayInput(EnvrnNum)%RainInd=0
ELSE
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)// &
'", invalid field: '//TRIM(cAlphaFieldNames(7))//'="'//TRIM(cAlphaArgs(7))//'".')
CALL ShowContinueError('"No" will be used.')
DesDayInput(EnvrnNum)%RainInd=0
ENDIF
! A8, \field Snow Indicator
IF (SameString(cAlphaArgs(8),'Yes') .or. SameString(cAlphaArgs(8),'1') ) THEN
DesDayInput(EnvrnNum)%SnowInd=1
ELSEIF (SameString(cAlphaArgs(8),'No') .or. SameString(cAlphaArgs(8),'0') .or. lAlphaFieldBlanks(8)) THEN
DesDayInput(EnvrnNum)%SnowInd=0
ELSE
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)// &
'", invalid field: '//TRIM(cAlphaFieldNames(8))//'="'//TRIM(cAlphaArgs(8))//'".')
CALL ShowContinueError('"No" will be used.')
DesDayInput(EnvrnNum)%SnowInd=0
ENDIF
! A3, \field Dry-Bulb Temperature Range Modifier Type
! check DB profile input
IF (lAlphaFieldBlanks(3)) THEN
cAlphaArgs(3)='DefaultMultipliers'
DesDayInput(EnvrnNum)%DBTempRangeType = DDDBRangeType_Default
ELSEIF (SameString(cAlphaArgs(3),'Multiplier') .or. SameString(cAlphaArgs(3),'MultiplierSchedule')) THEN
cAlphaArgs(3)='MultiplierSchedule'
DesDayInput(EnvrnNum)%DBTempRangeType = DDDBRangeType_Multiplier
units='[]'
ELSEIF (SameString(cAlphaArgs(3),'Difference') .or. SameString(cAlphaArgs(3),'Delta') .or. &
SameString(cAlphaArgs(3),'DifferenceSchedule') .or. SameString(cAlphaArgs(3),'DeltaSchedule')) THEN
cAlphaArgs(3)='DifferenceSchedule'
DesDayInput(EnvrnNum)%DBTempRangeType = DDDBRangeType_Difference
units='[deltaC]'
ELSEIF (SameString(cAlphaArgs(3),'DefaultMultipliers')) THEN
cAlphaArgs(3)='DefaultMultipliers'
DesDayInput(EnvrnNum)%DBTempRangeType = DDDBRangeType_Default
! Validate Temperature - Daily range
ELSEIF (SameString(cAlphaArgs(3),'TemperatureProfileSchedule')) THEN
cAlphaArgs(3)='TemperatureProfileSchedule'
DesDayInput(EnvrnNum)%DBTempRangeType = DDDBRangeType_Profile
units='[C]'
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(3))//'="'//TRIM(cAlphaArgs(3))//'".')
ErrorsFound=.true.
cAlphaArgs(3)='invalid field'
DesDayInput(EnvrnNum)%DBTempRangeType = DDDBRangeType_Default
ENDIF
IF (DesDayInput(EnvrnNum)%DBTempRangeType /= DDDBRangeType_Profile .and. .not. MaxDryBulbEntered .and. &
cAlphaArgs(3) /= 'invalid field') THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid blank field: '//TRIM(cNumericFieldNames(3)))
CALL ShowContinueError('..this field is required when '//trim(cAlphaFieldNames(3))//'="'// &
trim(cAlphaArgs(3))//'".')
ErrorsFound=.true.
ENDIF
! Assume either "multiplier" option will make full use of range...
IF (DesDayInput(EnvrnNum)%DBTempRangeType /= DDDBRangeType_Difference .and. &
DesDayInput(EnvrnNum)%DBTempRangeTYpe /= DDDBRangeType_Profile) THEN
testval=DesDayInput(EnvrnNum)%MaxDryBulb-DesDayInput(EnvrnNum)%DailyDBRange
errflag=.false.
CALL RangeCheck(errflag,cAlphaFieldNames(3),cCurrentModuleObject,'Severe','>= -90',(testval>=-90.d0), &
'<= 70',(testval <=70.d0),WhatObjectName=DesDayInput(EnvrnNum)%Title)
IF (errflag) THEN
ErrorsFound=.true.
ENDIF
ENDIF
! A4, \field Dry-Bulb Temperature Range Modifier Day Schedule Name
IF (DesDayInput(EnvrnNum)%DBTempRangeType /= DDDBRangeType_Default) THEN
IF (.not. lAlphaFieldBlanks(4)) THEN
DesDayInput(EnvrnNum)%TempRangeSchPtr=GetDayScheduleIndex(cAlphaArgs(4))
IF (DesDayInput(EnvrnNum)%TempRangeSchPtr == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(4))//'="'//TRIM(cAlphaArgs(4))//'".')
ErrorsFound=.true.
ELSE
CALL GetSingleDayScheduleValues(DesDayInput(EnvrnNum)%TempRangeSchPtr,DDDBRngModifier(EnvrnNum,:,:))
schPtr=FindNumberInList(DesDayInput(EnvrnNum)%TempRangeSchPtr,SPSiteScheduleNamePtr,NumSPSiteScheduleNamePtrs)
IF (schPtr == 0) THEN
NumSPSiteScheduleNamePtrs=NumSPSiteScheduleNamePtrs+1
SPSiteScheduleNamePtr(NumSPSiteScheduleNamePtrs)=DesDayInput(EnvrnNum)%TempRangeSchPtr
SPSiteScheduleUnits(NumSPSiteScheduleNamePtrs)=units
CALL SetupOutputVariable('Sizing Period Site Drybulb Temperature Range Modifier Schedule Value '//units, &
SPSiteDryBulbRangeModScheduleValue(EnvrnNum),'Zone','Average',cAlphaArgs(4))
ELSEIF (SPSiteScheduleUnits(schPtr)/= units) THEN
NumSPSiteScheduleNamePtrs=NumSPSiteScheduleNamePtrs+1
SPSiteScheduleNamePtr(NumSPSiteScheduleNamePtrs)=DesDayInput(EnvrnNum)%TempRangeSchPtr
SPSiteScheduleUnits(NumSPSiteScheduleNamePtrs)=units
CALL SetupOutputVariable('Sizing Period Site Drybulb Temperature Range Modifier Schedule Value '//units, &
SPSiteDryBulbRangeModScheduleValue(EnvrnNum),'Zone','Average',cAlphaArgs(4))
ENDIF
IF (cAlphaArgs(3) == 'MultiplierSchedule') THEN
IF ( .not. CheckDayScheduleValueMinMax(DesDayInput(EnvrnNum)%TempRangeSchPtr,0.0d0,'>=',1.0d0,'<=')) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(4))//'="'//TRIM(cAlphaArgs(4))//'".')
CALL ShowContinueError('..Specified [Schedule] Dry-bulb Range Multiplier Values are not within [0.0, 1.0]')
ErrorsFound=.true.
ENDIF
ELSEIF (cAlphaArgs(3) == 'DifferenceSchedule') THEN ! delta, must be > 0.0
IF (.not. CheckDayScheduleValueMinMax(DesDayInput(EnvrnNum)%TempRangeSchPtr,0.0d0,'>=')) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(4))//'="'//TRIM(cAlphaArgs(4))//'".')
CALL ShowSevereError('Some [Schedule] Dry-bulb Range Difference Values are < 0.0 [would make max larger].')
ErrorsFound=.true.
ENDIF
ENDIF
IF (cAlphaArgs(3) == 'TemperatureProfileSchedule') THEN
testval=MAXVAL(DDDBRngModifier(EnvrnNum,:,:))
IF (MaxDryBulbEntered) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", data override.')
CALL ShowContinueError('..'//trim(cNumericFieldNames(3))//'=['// &
trim(RoundSigDigits(DesDayInput(EnvrnNum)%MaxDryBulb,2))//'] will be overwritten.')
CALL ShowContinueError('..'//trim(cAlphaFieldNames(3))//'="'//trim(cAlphaArgs(3))//'".')
CALL ShowContinueError('..with max value=['//trim(RoundSigDigits(testval,2))//'].')
ENDIF
DesDayInput(EnvrnNum)%MaxDryBulb=testval
ENDIF
testval=MAXVAL(DDDBRngModifier(EnvrnNum,:,:))
testval=DesDayInput(EnvrnNum)%MaxDryBulb-testval
errflag=.false.
CALL RangeCheck(errflag,TRIM(cAlphaFieldNames(4)),TRIM(cCurrentModuleObject),'Severe','>= -90',(testval>=-90.d0), &
'<= 70',(testval <=70.d0),WhatObjectName=DesDayInput(EnvrnNum)%Title)
IF (errflag) THEN
ErrorsFound=.true.
ENDIF
ENDIF
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(4))//' is blank.')
CALL ShowContinueError('..required when '//TRIM(cAlphaFieldNames(3))//' indicates "SCHEDULE".')
ErrorsFound=.true.
ENDIF
ELSE
! Default dry-bulb temperature Range
LastHrValue=DefaultTempRangeMult(24)
DO HrLoop=1,24
DO TSLoop=1,NumOfTimeStepInHour
WNow=Interpolation(TSLoop)
WPrev=1.0-WNow
DDDBRngModifier(EnvrnNum,HrLoop,TSLoop)=LastHrValue*WPrev+DefaultTempRangeMult(HrLoop)*WNow
ENDDO
LastHrValue=DefaultTempRangeMult(HrLoop)
ENDDO
ENDIF
! A5, \field Humidity Condition Type
IF (SameString(cAlphaArgs(5),'WetBulb')) THEN
cAlphaArgs(5)='WetBulb'
! N5, \field Wetbulb or DewPoint at Maximum Dry-Bulb
IF (.not. lNumericFieldBlanks(5)) THEN
DesDayInput(EnvrnNum)%HumIndValue = rNumericArgs(5) ! Humidity Indicating Conditions at Max Dry-Bulb
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cNumericFieldNames(5))//' is blank.')
CALL ShowContinueError('..field is required when '//trim(cAlphaFieldNames(5))//'="'//trim(cAlphaArgs(5))//'".')
ErrorsFound=.true.
ENDIF
errflag=.false.
DesDayInput(EnvrnNum)%HumIndType=DDHumIndType_Wetbulb
CALL RangeCheck(errflag,TRIM(cAlphaFieldNames(5))//' - Wet-Bulb',cCurrentModuleObject,'Severe','>= -90', &
(DesDayInput(EnvrnNum)%HumIndValue>=-90.d0),'<= 70',(DesDayInput(EnvrnNum)%HumIndValue <=70.d0), &
WhatObjectName=DesDayInput(EnvrnNum)%Title)
IF (errflag) THEN
! CALL ShowContinueError(TRIM(cCurrentModuleObject)//': Occured in '//TRIM(DesDayInput(EnvrnNum)%Title))
ErrorsFound=.true.
ENDIF
ELSEIF (SameString(cAlphaArgs(5),'DewPoint')) THEN
cAlphaArgs(5)='DewPoint'
IF (.not. lNumericFieldBlanks(5)) THEN
DesDayInput(EnvrnNum)%HumIndValue = rNumericArgs(5) ! Humidity Indicating Conditions at Max Dry-Bulb
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cNumericFieldNames(5))//' is blank.')
CALL ShowContinueError('..field is required when '//trim(cAlphaFieldNames(5))//'="'//trim(cAlphaArgs(5))//'".')
ErrorsFound=.true.
ENDIF
errflag=.false.
DesDayInput(EnvrnNum)%HumIndType=DDHumIndType_Dewpoint
CALL RangeCheck(errflag,TRIM(cAlphaFieldNames(5))//' - Dew-Point',TRIM(cCurrentModuleObject),'Severe','>= -90', &
(DesDayInput(EnvrnNum)%HumIndValue>=-90.d0),'<= 70',(DesDayInput(EnvrnNum)%HumIndValue <=70.d0), &
WhatObjectName=DesDayInput(EnvrnNum)%Title)
IF (errflag) THEN
ErrorsFound=.true.
ENDIF
ELSEIF (SameString(cAlphaArgs(5),'HumidityRatio')) THEN
cAlphaArgs(5)='HumidityRatio'
! N6, \field Humidity Ratio at Maximum Dry-Bulb
IF (.not. lNumericFieldBlanks(6)) THEN
DesDayInput(EnvrnNum)%HumIndValue = rNumericArgs(6) ! Humidity Indicating Conditions at Max Dry-Bulb
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cNumericFieldNames(6))//' is blank.')
CALL ShowContinueError('..field is required when '//trim(cAlphaFieldNames(5))//'="'//trim(cAlphaArgs(5))//'".')
ErrorsFound=.true.
ENDIF
errflag=.false.
DesDayInput(EnvrnNum)%HumIndType=DDHumIndType_HumRatio
CALL RangeCheck(errflag,TRIM(cAlphaFieldNames(5))//' - Humidity-Ratio',TRIM(cCurrentModuleObject),'Severe','>= 0', &
(DesDayInput(EnvrnNum)%HumIndValue>=0.d0),'<= .03',(DesDayInput(EnvrnNum)%HumIndValue <=.03d0), &
WhatObjectName=DesDayInput(EnvrnNum)%Title)
IF (errflag) THEN
ErrorsFound=.true.
ENDIF
ELSEIF (SameString(cAlphaArgs(5),'Enthalpy')) THEN
cAlphaArgs(5)='Enthalpy'
! N7, \field Enthalpy at Maximum Dry-Bulb !will require units transition.
IF (.not. lNumericFieldBlanks(7)) THEN
DesDayInput(EnvrnNum)%HumIndValue = rNumericArgs(7) ! Humidity Indicating Conditions at Max Dry-Bulb
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cNumericFieldNames(7))//' is blank.')
CALL ShowContinueError('..field is required when '//trim(cAlphaFieldNames(5))//'="'//trim(cAlphaArgs(5))//'".')
ErrorsFound=.true.
ENDIF
errflag=.false.
DesDayInput(EnvrnNum)%HumIndType=DDHumIndType_Enthalpy
CALL RangeCheck(errflag,TRIM(cAlphaFieldNames(5))//' - Enthalpy','SizingPeriod:DesignDay','Severe','>= 0.0', &
(DesDayInput(EnvrnNum)%HumIndValue>=0.d0),'<= 130000',(DesDayInput(EnvrnNum)%HumIndValue <=130000.d0), &
WhatObjectName=DesDayInput(EnvrnNum)%Title)
IF (errflag) THEN
ErrorsFound=.true.
ENDIF
ELSEIF (SameString(cAlphaArgs(5),'RelativeHumiditySchedule')) THEN
cAlphaArgs(5)='RelativeHumiditySchedule'
DesDayInput(EnvrnNum)%HumIndType=DDHumIndType_RelHumSch
units='[%]'
ELSEIF (SameString(cAlphaArgs(5),'WetBulbProfileMultiplierSchedule')) THEN
cAlphaArgs(5)='WetBulbProfileMultiplierSchedule'
DesDayInput(EnvrnNum)%HumIndType=DDHumIndType_WBProfMul
units='[]'
IF (.not. lNumericFieldBlanks(5)) THEN
DesDayInput(EnvrnNum)%HumIndValue = rNumericArgs(5) ! Humidity Indicating Conditions at Max Dry-Bulb
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cNumericFieldNames(5))//' is blank.')
CALL ShowContinueError('..field is required when '//trim(cAlphaFieldNames(5))//'="'//trim(cAlphaArgs(5))//'".')
ErrorsFound=.true.
ENDIF
ELSEIF (SameString(cAlphaArgs(5),'WetBulbProfileDifferenceSchedule')) THEN
cAlphaArgs(5)='WetBulbProfileDifferenceSchedule'
DesDayInput(EnvrnNum)%HumIndType=DDHumIndType_WBProfDif
units='[]'
IF (.not. lNumericFieldBlanks(5)) THEN
DesDayInput(EnvrnNum)%HumIndValue = rNumericArgs(5) ! Humidity Indicating Conditions at Max Dry-Bulb
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cNumericFieldNames(5))//' is blank.')
CALL ShowContinueError('..field is required when '//trim(cAlphaFieldNames(5))//'="'//trim(cAlphaArgs(5))//'".')
ErrorsFound=.true.
ENDIF
ELSEIF (SameString(cAlphaArgs(5),'WetBulbProfileDefaultMultipliers')) THEN
cAlphaArgs(5)='WetBulbProfileDefaultMultipliers'
DesDayInput(EnvrnNum)%HumIndType=DDHumIndType_WBProfDef
IF (.not. lNumericFieldBlanks(5)) THEN
DesDayInput(EnvrnNum)%HumIndValue = rNumericArgs(5) ! Humidity Indicating Conditions at Max Dry-Bulb
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cNumericFieldNames(5))//' is blank.')
CALL ShowContinueError('..field is required when '//trim(cAlphaFieldNames(5))//'="'//trim(cAlphaArgs(5))//'".')
ErrorsFound=.true.
ENDIF
ELSE
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(5))//'="'//TRIM(cAlphaArgs(5))//'".')
CALL ShowContinueError('WetBulb will be used. Maximum Dry Bulb will be used as WetBulb at Maximum Dry Bulb.')
cAlphaArgs(5)='WetBulb'
DesDayInput(EnvrnNum)%HumIndType=DDHumIndType_Wetbulb
DesDayInput(EnvrnNum)%HumIndValue = rNumericArgs(3)
ENDIF
! resolve humidity schedule if needed
! A6, \field Humidity Condition Day Schedule Name
IF (DesDayInput(EnvrnNum)%HumIndType == DDHumIndType_RelHumSch .or. &
DesDayInput(EnvrnNum)%HumIndType == DDHumIndType_WBProfMul .or. &
DesDayInput(EnvrnNum)%HumIndType == DDHumIndType_WBProfDif) THEN
IF (lAlphaFieldBlanks(6)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(6))//' is blank.')
CALL ShowContinueError('..field is required when '//TRIM(cAlphaFieldNames(3))//'="'// TRIM(cAlphaArgs(3)) // '".')
ErrorsFound=.true.
ELSE
DesDayInput(EnvrnNum)%HumIndSchPtr=GetDayScheduleIndex(cAlphaArgs(6))
IF (DesDayInput(EnvrnNum)%HumIndSchPtr == 0) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(6))//'="'//TRIM(cAlphaArgs(6))//'".')
CALL ShowContinueError('Default Humidity will be used (constant for day using Humidity Indicator Temp).')
! reset HumIndType ?
ELSE
CALL GetSingleDayScheduleValues( DesDayInput(EnvrnNum)%HumIndSchPtr, DDHumIndModifier(EnvrnNum,:,:))
schPtr=FindNumberInList(DesDayInput(EnvrnNum)%HumIndSchPtr,SPSiteScheduleNamePtr,NumSPSiteScheduleNamePtrs)
IF (schPtr == 0) THEN
NumSPSiteScheduleNamePtrs=NumSPSiteScheduleNamePtrs+1
SPSiteScheduleNamePtr(NumSPSiteScheduleNamePtrs)=DesDayInput(EnvrnNum)%HumIndSchPtr
SPSiteScheduleUnits(NumSPSiteScheduleNamePtrs)=units
CALL SetupOutputVariable('Sizing Period Site Humidity Condition Schedule Value '//units, &
SPSiteHumidityConditionScheduleValue(EnvrnNum),'Zone','Average',cAlphaArgs(6))
ELSEIF (SPSiteScheduleUnits(schPtr)/= units) THEN
NumSPSiteScheduleNamePtrs=NumSPSiteScheduleNamePtrs+1
SPSiteScheduleNamePtr(NumSPSiteScheduleNamePtrs)=DesDayInput(EnvrnNum)%HumIndSchPtr
SPSiteScheduleUnits(NumSPSiteScheduleNamePtrs)=units
CALL SetupOutputVariable('Sizing Period Site Humidity Condition Schedule Value '//units, &
SPSiteHumidityConditionScheduleValue(EnvrnNum),'Zone','Average',cAlphaArgs(6))
ENDIF
SELECT CASE (DesDayInput(EnvrnNum)%HumIndType)
CASE (DDHumIndType_RelHumSch)
IF ( .not. CheckDayScheduleValueMinMax(DesDayInput(EnvrnNum)%HumIndSchPtr,0.0,'>=',100.0,'<=')) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(6))//'="'//TRIM(cAlphaArgs(6))//'".')
CALL ShowContinueError('Specified [Scheduled] Relative Humidity Values are not within [0.0, 100.0]')
ErrorsFound=.true.
ENDIF
CASE (DDHumIndType_WBProfMul)
! multiplier: use schedule value, check 0 <= v <= 1
IF ( .not. CheckDayScheduleValueMinMax(DesDayInput(EnvrnNum)%HumIndSchPtr,0.0d0,'>=',1.0d0,'<=')) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(6))//'="'//TRIM(cAlphaArgs(6))//'".')
CALL ShowContinueError('..Specified [Schedule] Wet-bulb Profile Range Multiplier Values are not within [0.0, 1.0]')
ErrorsFound=.true.
ENDIF
CASE (DDHumIndType_WBProfDif)
IF (.not. CheckDayScheduleValueMinMax(DesDayInput(EnvrnNum)%HumIndSchPtr,0.0d0,'>=')) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(6))//'="'//TRIM(cAlphaArgs(6))//'".')
CALL ShowSevereError('Some [Schedule] Wet-bulb Profile Difference Values are < 0.0 [would make max larger].')
ErrorsFound=.true.
ENDIF
END SELECT
END IF
END IF
ELSE IF (DesDayInput(EnvrnNum)%HumIndType == DDHumIndType_WBProfDef) THEN
! re WetBulbProfileDefaultMultipliers
LastHrValue=DefaultTempRangeMult(24)
DO HrLoop=1,24
DO TSLoop=1,NumOfTimeStepInHour
WNow=Interpolation(TSLoop)
WPrev=1.0-WNow
DDHumIndModifier(EnvrnNum,HrLoop,TSLoop)=LastHrValue*WPrev+DefaultTempRangeMult(HrLoop)*WNow
ENDDO
LastHrValue=DefaultTempRangeMult(HrLoop)
ENDDO
! ELSE missing case?
ENDIF
! verify that design WB or DP <= design DB
IF (DesDayInput(EnvrnNum)%HumIndType == DDHumIndType_Dewpoint .or. &
DesDayInput(EnvrnNum)%HumIndType == DDHumIndType_Wetbulb .or. &
DesDayInput(EnvrnNum)%HumIndType == DDHumIndType_WBProfMul .or. &
DesDayInput(EnvrnNum)%HumIndType == DDHumIndType_WBProfDef .or. &
DesDayInput(EnvrnNum)%HumIndType == DDHumIndType_WBProfDif) THEN
IF (DesDayInput(EnvrnNum)%HumIndValue > DesDayInput(EnvrnNum)%MaxDryBulb) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", range check data.')
CALL ShowContinueError('..Humidity Indicator Temperature at Max Temperature='// &
TRIM(RoundSigDigits(DesDayInput(EnvrnNum)%HumIndValue,1))// &
' > Max DryBulb='//TRIM(RoundSigDigits(DesDayInput(EnvrnNum)%MaxDryBulb,1)))
CALL ShowContinueError('..'//TRIM(cAlphaFieldNames(5))//'="'//TRIM(cAlphaArgs(5))//'".')
CALL ShowContinueError('..Conditions for day will be set to Relative Humidity = 100%')
IF (DesDayInput(EnvrnNum)%HumIndType == DDHumIndType_Dewpoint) THEN
DesDayInput(EnvrnNum)%DewpointNeedsSet = .true.
ELSE
! wet-bulb
DesDayInput(EnvrnNum)%HumIndValue = DesDayInput(EnvrnNum)%MaxDryBulb
ENDIF
ENDIF
ENDIF
! A10, \field Solar Model Indicator
IF (lAlphaFieldBlanks(10)) THEN
DesDayInput(EnvrnNum)%SolarModel = ASHRAE_ClearSky
ELSEIF (SameString(cAlphaArgs(10),'ASHRAEClearSky') .or. SameString(cAlphaArgs(10),'CLEARSKY')) THEN
DesDayInput(EnvrnNum)%SolarModel = ASHRAE_ClearSky
ELSEIF (SameString(cAlphaArgs(10),'ZhangHuang')) THEN
DesDayInput(EnvrnNum)%SolarModel = Zhang_Huang
ELSEIF (SameString(cAlphaArgs(10), 'ASHRAETau')) THEN
DesDayInput(EnvrnNum)%SolarModel = ASHRAE_Tau
ELSEIF (SameString(cAlphaArgs(10),'Schedule')) THEN
DesDayInput(EnvrnNum)%SolarModel = SolarModel_Schedule
ELSE
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(10))//'="'//TRIM(cAlphaArgs(10))//'".')
CALL ShowContinueError('Model used will be ASHRAE ClearSky')
DesDayInput(EnvrnNum)%SolarModel = ASHRAE_ClearSky
ENDIF
IF (DesDayInput(EnvrnNum)%SolarModel == SolarModel_Schedule) THEN
! A11, \field Beam Solar Day Schedule Name
IF (.not. lAlphaFieldBlanks(11)) THEN
DesDayInput(EnvrnNum)%BeamSolarSchPtr=GetDayScheduleIndex(cAlphaArgs(11))
IF (DesDayInput(EnvrnNum)%BeamSolarSchPtr == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(11))//'="'//TRIM(cAlphaArgs(11))//'".')
CALL ShowContinueError('..Required when '//TRIM(cAlphaFieldNames(10))//' indicates "Schedule".')
ErrorsFound=.true.
ELSE
CALL GetSingleDayScheduleValues(DesDayInput(EnvrnNum)%BeamSolarSchPtr,DDBeamSolarValues(EnvrnNum,:,:))
schPtr=FindNumberInList(DesDayInput(EnvrnNum)%BeamSolarSchPtr,SPSiteScheduleNamePtr,NumSPSiteScheduleNamePtrs)
units='[W/m2]'
IF (schPtr == 0) THEN
NumSPSiteScheduleNamePtrs=NumSPSiteScheduleNamePtrs+1
SPSiteScheduleNamePtr(NumSPSiteScheduleNamePtrs)=DesDayInput(EnvrnNum)%BeamSolarSchPtr
SPSiteScheduleUnits(NumSPSiteScheduleNamePtrs)=units
CALL SetupOutputVariable('Sizing Period Site Beam Solar Schedule Value '//units, &
SPSiteBeamSolarScheduleValue(EnvrnNum),'Zone','Average',cAlphaArgs(11))
ELSEIF (SPSiteScheduleUnits(schPtr)/= units) THEN
NumSPSiteScheduleNamePtrs=NumSPSiteScheduleNamePtrs+1
SPSiteScheduleNamePtr(NumSPSiteScheduleNamePtrs)=DesDayInput(EnvrnNum)%BeamSolarSchPtr
SPSiteScheduleUnits(NumSPSiteScheduleNamePtrs)=units
CALL SetupOutputVariable('Sizing Period Site Beam Solar Schedule Value '//units, &
SPSiteBeamSolarScheduleValue(EnvrnNum),'Zone','Average',cAlphaArgs(11))
ENDIF
IF ( .not. CheckDayScheduleValueMinMax(DesDayInput(EnvrnNum)%BeamSolarSchPtr,0.0,'>=')) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(11))//'="'//TRIM(cAlphaArgs(11))//'".')
CALL ShowContinueError('..Specified [Schedule] Values are not >= 0.0')
ErrorsFound=.true.
ENDIF
ENDIF
ELSE ! should have entered beam schedule
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(11))//' is blank.')
ErrorsFound=.true.
ENDIF
! A12, \field Diffuse Solar Day Schedule Name
IF (.not. lAlphaFieldBlanks(12)) THEN
DesDayInput(EnvrnNum)%DiffuseSolarSchPtr=GetDayScheduleIndex(cAlphaArgs(12))
IF (DesDayInput(EnvrnNum)%DiffuseSolarSchPtr == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(12))//'="'//TRIM(cAlphaArgs(12))//'".')
CALL ShowContinueError('..Required when '//TRIM(cAlphaFieldNames(10))//' indicates "Schedule".')
ErrorsFound=.true.
ELSE
CALL GetSingleDayScheduleValues(DesDayInput(EnvrnNum)%DiffuseSolarSchPtr,DDDiffuseSolarValues(EnvrnNum,:,:))
schPtr=FindNumberInList(DesDayInput(EnvrnNum)%DiffuseSolarSchPtr,SPSiteScheduleNamePtr,NumSPSiteScheduleNamePtrs)
units='[W/m2]'
IF (schPtr == 0) THEN
NumSPSiteScheduleNamePtrs=NumSPSiteScheduleNamePtrs+1
SPSiteScheduleNamePtr(NumSPSiteScheduleNamePtrs)=DesDayInput(EnvrnNum)%DiffuseSolarSchPtr
SPSiteScheduleUnits(NumSPSiteScheduleNamePtrs)=units
CALL SetupOutputVariable('Sizing Period Site Diffuse Solar Schedule Value '//units, &
SPSiteDiffuseSolarScheduleValue(EnvrnNum),'Zone','Average',cAlphaArgs(12))
ELSEIF (SPSiteScheduleUnits(schPtr)/= units) THEN
NumSPSiteScheduleNamePtrs=NumSPSiteScheduleNamePtrs+1
SPSiteScheduleNamePtr(NumSPSiteScheduleNamePtrs)=DesDayInput(EnvrnNum)%DiffuseSolarSchPtr
SPSiteScheduleUnits(NumSPSiteScheduleNamePtrs)=units
CALL SetupOutputVariable('Sizing Period Site Diffuse Solar Schedule Value '//units, &
SPSiteDiffuseSolarScheduleValue(EnvrnNum),'Zone','Average',cAlphaArgs(12))
ENDIF
IF ( .not. CheckDayScheduleValueMinMax(DesDayInput(EnvrnNum)%DiffuseSolarSchPtr,0.0,'>=')) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(12))//'="'//TRIM(cAlphaArgs(12))//'".')
CALL ShowContinueError('..Specified [Schedule] Values are not >= 0.0')
ErrorsFound=.true.
ENDIF
ENDIF
ELSE ! should have entered diffuse schedule
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(12))//' is blank.')
ErrorsFound=.true.
ENDIF
ENDIF
IF (DesDayInput(EnvrnNum)%SolarModel == ASHRAE_ClearSky) THEN
IF (lNumericFieldBlanks(14)) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cNumericFieldNames(14))//' is blank.')
CALL ShowContinueError('..Zero clear sky (no solar) will be used.')
ENDIF
ENDIF
! Validate Design Day Month
SELECT CASE (DesDayInput(EnvrnNum)%Month)
CASE (1,3,5,7,8,10,12)
IF (DesDayInput(EnvrnNum)%DayOfMonth > 31) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('.. invalid field: '//TRIM(cNumericFieldNames(2))//'=['// &
TRIM(RoundSigDigits(DesDayInput(EnvrnNum)%DayOfMonth))// &
'], Month=['//trim(RoundSigDigits(DesDayInput(EnvrnNum)%Month))//'].')
ErrorsFound=.true.
ENDIF
CASE (4,6,9,11)
IF (DesDayInput(EnvrnNum)%DayOfMonth > 30) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('.. invalid '//TRIM(cNumericFieldNames(2))//'=['// &
TRIM(RoundSigDigits(DesDayInput(EnvrnNum)%DayOfMonth))// &
'], Month=['//trim(RoundSigDigits(DesDayInput(EnvrnNum)%Month))//'].')
ErrorsFound=.true.
ENDIF
CASE (2)
IF (DesDayInput(EnvrnNum)%DayOfMonth > 28) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('.. invalid '//TRIM(cNumericFieldNames(2))//'=['// &
TRIM(RoundSigDigits(DesDayInput(EnvrnNum)%DayOfMonth))// &
'], Month=['//trim(RoundSigDigits(DesDayInput(EnvrnNum)%Month))//'].')
ErrorsFound=.true.
ENDIF
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('.. invalid '//TRIM(cNumericFieldNames(1))//' invalid (Month) ['// &
TRIM(RoundSigDigits(DesDayInput(EnvrnNum)%Month))//'].')
ErrorsFound=.true.
END SELECT
! A9, \field Daylight Saving Time Indicator
IF (SameString(cAlphaArgs(9),'Yes') .or. SameString(cAlphaArgs(9),'1') ) THEN
DesDayInput(EnvrnNum)%DSTIndicator=1
ELSEIF (SameString(cAlphaArgs(9),'No') .or. SameString(cAlphaArgs(9),'0') .or. lAlphaFieldBlanks(9)) THEN
DesDayInput(EnvrnNum)%DSTIndicator=0
ELSE
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(9))//'="'//TRIM(cAlphaArgs(9))//'". "No" will be used.')
DesDayInput(EnvrnNum)%DSTIndicator=0
ENDIF
! A2, \field Day Type
DesDayInput(EnvrnNum)%DayType=FindItemInList(cAlphaArgs(2),ValidNames,12)
IF (DesDayInput(EnvrnNum)%DayType == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(DesDayInput(EnvrnNum)%Title)//'", invalid data.')
CALL ShowContinueError('..invalid field: '//TRIM(cAlphaFieldNames(2))//'="'//TRIM(cAlphaArgs(2))//'".')
CALL ShowContinueError('Valid values are Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,'// &
'Holiday,SummerDesignDay,WinterDesignDay,CustomDay1,CustomDay2.')
ErrorsFound=.true.
ENDIF
Environment(EnvrnNum)%Title=DesDayInput(EnvrnNum)%Title
Environment(EnvrnNum)%KindOfEnvrn = ksDesignDay
Environment(EnvrnNum)%TotalDays=1
Environment(EnvrnNum)%StartMonth=DesDayInput(EnvrnNum)%Month
Environment(EnvrnNum)%StartDay=DesDayInput(EnvrnNum)%DayOfMonth
Environment(EnvrnNum)%EndMonth=Environment(EnvrnNum)%StartMonth
Environment(EnvrnNum)%EndDay=Environment(EnvrnNum)%StartDay
Environment(EnvrnNum)%DayOfWeek=0
Environment(EnvrnNum)%UseDST=.false.
Environment(EnvrnNum)%UseHolidays=.false.
Environment(EnvrnNum)%StartJDay = DesignDay(EnvrnNum)%DayOfYear
Environment(EnvrnNum)%EndJDay=Environment(EnvrnNum)%StartJDay
!create predefined report on design day
envTitle = DesDayInput(EnvrnNum)%Title
CALL PreDefTableEntry(pdchDDmaxDB,envTitle,DesDayInput(EnvrnNum)%MaxDryBulb)
CALL PreDefTableEntry(pdchDDrange,envTitle,DesDayInput(EnvrnNum)%DailyDBRange)
IF (DesDayInput(EnvrnNum)%HumIndType /= DDHumIndType_RelHumSch) THEN
CALL PreDefTableEntry(pdchDDhumid,envTitle,DesDayInput(EnvrnNum)%HumIndValue)
ELSE
CALL PreDefTableEntry(pdchDDhumid,envTitle,'N/A')
ENDIF
CALL PreDefTableEntry(pdchDDhumTyp,envTitle,HumidityIndicatingType(DesDayInput(EnvrnNum)%HumIndType))
CALL PreDefTableEntry(pdchDDwindSp,envTitle,DesDayInput(EnvrnNum)%WindSpeed)
CALL PreDefTableEntry(pdchDDwindDr,envTitle,DesDayInput(EnvrnNum)%WindDir)
End Do
Return
END SUBROUTINE GetDesignDayData