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 GetSpecialDayPeriodData(ErrorsFound)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN June 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine reads any special day period data from the IDF and
! processes it into the data structure that will drive the values
! in the SpecialDayTypes array.
! METHODOLOGY EMPLOYED:
! Processes the following IDD definition:
!
! SpecialDayPeriod,
! \memo This object sets up holidays/special days to be used during weather file
! \memo run periods. (These are not used with DesignDay objects.)
! \memo Depending on the value in the run period, days on the weather file may also
! \memo be used. However, the weather file specification will take precedence over
! \memo any specification shown here. (No error message on duplicate days or overlapping
! \memo days).
! A1, \field Holiday Name
! A2, \field StartDate
! \memo Dates can be several formats:
! \memo <number>/<number> (month/day)
! \memo <number> Month
! \memo Month <number>
! \memo Months are January, February, March, April, May, June, July, August, September, October, November, December
! \memo Months can be the first 3 letters of the month
! \note will eventually allow: 3 Monday April (meaning 3rd Monday in April)
! N1, \field duration (number of days)
! A3; \field SpecialDayType
! \note SpecialDayType selects the schedules appropriate for each day so labeled
! \type choice
! \key Holiday
! \key SummerDesignDay
! \key WinterDesignDay
! \key CustomDay1
! \key CustomDay2
! REFERENCES:
! na
! USE STATEMENTS:
USE DataIPShortCuts
USE InputProcessor, ONLY: GetNumObjectsFound, FindItemInList, GetObjectItem, VerifyName
USE General, ONLY: TrimSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(INOUT) :: ErrorsFound ! will be set to true if severe errors are found in inputs
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER, DIMENSION(5) :: ValidDayTypes=(/"HOLIDAY ","SUMMERDESIGNDAY", &
"WINTERDESIGNDAY","CUSTOMDAY1 ","CUSTOMDAY2 "/)
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=MaxNameLength), DIMENSION(3) :: AlphArray
INTEGER NumAlphas
REAL(r64), DIMENSION(1) :: Duration
INTEGER NumNumbers
INTEGER NumSpecDays
INTEGER Count
INTEGER Loop
INTEGER PMonth
INTEGER PDay
INTEGER PWeekDay
INTEGER DateType
INTEGER IOStat
INTEGER DayType
LOGICAL :: IsNotOK=.false. ! Flag to verify name
LOGICAL :: IsBlank=.false. ! Flag for blank name
cCurrentModuleObject='RunPeriodControl:SpecialDays'
NumSpecDays=GetNumObjectsFound(cCurrentModuleObject)
IF (ALLOCATED(SpecialDays)) THEN ! EPW already allocated the array
Count=NumSpecialDays-NumSpecDays+1
ELSE
ALLOCATE(SpecialDays(NumSpecDays))
NumSpecialDays=NumSpecDays
Count=1
ENDIF
DO Loop=1,NumSpecDays
CALL GetObjectItem(cCurrentModuleObject,Loop,AlphArray,NumAlphas,Duration,NumNumbers,IOSTAT)
CALL VerifyName(AlphArray(1),SpecialDays%Name,Count-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) AlphArray(1)='xxxxx'
ENDIF
SpecialDays(Count)%Name=AlphArray(1)
CALL ProcessDateString(AlphArray(2),PMonth,PDay,PWeekDay,DateType,ErrorsFound)
IF (DateType == MonthDay) THEN
SpecialDays(Count)%DateType=DateType
SpecialDays(Count)%Month=PMonth
SpecialDays(Count)%Day=PDay
SpecialDays(Count)%WeekDay=0
SpecialDays(Count)%CompDate=PMonth*32+PDay
SpecialDays(Count)%WthrFile=.false.
ELSEIF (DateType /= InvalidDate) THEN
SpecialDays(Count)%DateType=DateType
SpecialDays(Count)%Month=PMonth
SpecialDays(Count)%Day=PDay
SpecialDays(Count)%WeekDay=PWeekDay
SpecialDays(Count)%CompDate=0
SpecialDays(Count)%WthrFile=.false.
ELSEIF (DateType == InvalidDate) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(AlphArray(1))//' Invalid '// &
TRIM(cAlphaFieldNames(2))//'='//TRIM(AlphArray(2)))
ErrorsFound=.true.
ENDIF
IF (Duration(1) > 0) THEN
SpecialDays(Count)%Duration=INT(Duration(1))
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(AlphArray(1))//' Invalid '// &
TRIM(cNumericFieldNames(1))//'='//TRIM(TrimSigDigits(Duration(1),0)))
ErrorsFound=.true.
ENDIF
DayType=FindItemInList(AlphArray(3),ValidDayTypes,5)
IF (DayType == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': '//TRIM(AlphArray(1))//' Invalid '// &
TRIM(cAlphaFieldNames(3))//'='//TRIM(AlphArray(3)))
ErrorsFound=.true.
ELSE
SpecialDays(Count)%DayType=DayType
ENDIF
Count=Count+1
ENDDO
!CALL CalcSpecialDayTypes
RETURN
END SUBROUTINE GetSpecialDayPeriodData