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) | :: | LevelOfDetail |
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 ReportScheduleDetails(LevelOfDetail)
! SUBROUTINE INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN January 2003
! MODIFIED February 2008 - add IDF outputs (compact schedules)
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine puts the details of the Schedules on the .eio file (Inits file).
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE General, ONLY: RoundSigDigits, InvJulianDay
USE DataGlobals, ONLY: OutputFileDebug
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: LevelOfDetail ! =1: hourly; =2: timestep; = 3: make IDF excerpt
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER, DIMENSION(12) :: Months=(/'Jan','Feb','Mar','Apr','May','Jun', &
'Jul','Aug','Sep','Oct','Nov','Dec'/)
CHARACTER(len=*), PARAMETER, DIMENSION(0:24) :: HrField=(/"00","01","02","03","04","05","06", &
"07","08","09","10","11","12", &
"13","14","15","16","17","18", &
"19","20","21","22","23","24"/)
CHARACTER(len=*), PARAMETER :: SchTFmt0="('! Schedule Details Report=',A,' =====================')"
CHARACTER(len=*), PARAMETER :: SchTFmt="('! <ScheduleType>,Name,Limited? {Yes/No},Minimum,Maximum,', &
& 'Continuous? {Yes/No - Discrete}')"
CHARACTER(len=*), PARAMETER :: SchSFmt="('! <Schedule>,Name,ScheduleType,{Until Date,WeekSchedule}** Repeated until Dec 31')"
CHARACTER(len=*), PARAMETER :: SchTFmtdata="('ScheduleTypeLimits',5(',',A))"
CHARACTER(len=*), PARAMETER :: SchWFmtdata="('Schedule:Week:Daily',13(',',A))"
CHARACTER(len=*), PARAMETER :: fmta='(A)'
CHARACTER(len=*), PARAMETER :: CMinFmt='(I2.2)'
CHARACTER(len=*), PARAMETER :: ThruFmt="(',Through ',A,1X,I2.2,',',A)"
CHARACTER(len=*), PARAMETER :: SchDFmt0="('! <DaySchedule>,Name,ScheduleType,Interpolated {Yes/No},Time (HH:MM) =>',"
CHARACTER(len=*), PARAMETER :: SchDFmtdata0="('DaySchedule,',A,',',A,',',A,',',A,"
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER Count
INTEGER Hr
INTEGER TS
INTEGER NumF
INTEGER PMon
INTEGER PDay
INTEGER iWeek
INTEGER iDay
INTEGER DT
INTEGER iDayP
CHARACTER(len=2), ALLOCATABLE, DIMENSION(:) :: ShowMinute
INTEGER CurMinute
CHARACTER(len=5), ALLOCATABLE, DIMENSION(:) :: TimeHHMM
CHARACTER(len=500) :: SchWFmt="('! <WeekSchedule>,Name"
CHARACTER(len=100) :: SchDFmt=' '
CHARACTER(len=100) :: SchDFmtdata=' '
CHARACTER(len=3) :: YesNo1
CHARACTER(len=3) :: YesNo2
CHARACTER(len=32) :: Num1
CHARACTER(len=32) :: Num2
CHARACTER(len=32), ALLOCATABLE, DIMENSION(:,:) :: RoundTSValue
ALLOCATE(ShowMinute(NumOfTimeStepInHour))
ALLOCATE(TimeHHMM(NumOfTimeStepInHour*24))
ALLOCATE(RoundTSValue(24,NumOfTimeStepInHour))
ShowMinute=Blank
TimeHHMM=Blank
RoundTSValue=Blank
CurMinute=MinutesPerTimeStep
DO Count=1,NumOfTimeStepInHour-1
WRITE(ShowMinute(Count),CMinFmt) CurMinute
CurMinute=CurMinute+MinutesPerTimeStep
ENDDO
ShowMinute(NumOfTimeStepInHour)='00'
SELECT CASE (LevelOfDetail)
CASE(1:2)
NumF=1
DO Hr=1,24
IF (LevelOfDetail == 2) THEN
DO TS=1,NumOfTimeStepInHour-1
TimeHHMM(NumF)=HrField(Hr-1)//':'//ShowMinute(TS)
NumF=NumF+1
ENDDO
ENDIF
TimeHHMM(NumF)=HrField(Hr)//':'//ShowMinute(NumOfTimeStepInHour)
NumF=NumF+1
ENDDO
NumF=NumF-1
! SchTFmt Schedule Types Header
IF (LevelOfDetail == 1) THEN
WRITE(OutputFileInits,SchTFmt0) 'Hourly'
SchDFmt=TRIM(SchDFmt0)//"24(',',A))"
SchDFmtdata=TRIM(SchDFmtdata0)//"24(',',A))"
ELSE
WRITE(OutputFileInits,SchTFmt0) 'Timestep'
WRITE(Num1,*) NumOfTimeStepInHour*24
Num1=ADJUSTL(Num1)
SchDFmt=TRIM(SchDFmt0)//TRIM(Num1)//"(',',A))"
SchDFmtdata=TRIM(SchDFmtdata0)//TRIM(Num1)//"(',',A))"
ENDIF
WRITE(OutputFileInits,SchTFmt)
! SchDFmt Header (DaySchedule) builds the appropriate set of commas/times based on detail level
! DO Count=1,NumF
! SchDFmt=TRIM(SchDFmt)//'A'
! IF (Count /= NumF) SchDFmt=TRIM(SchDFmt)//",',',"
! ENDDO
! SchDFmt=TRIM(SchDFmt)//')'
WRITE(OutputFileInits,SchDFmt) (TimeHHMM(Count),Count=1,NumF)
! SchWFmt Header (WeekSchedule)
DO Count=1,MaxDayTypes
SchWFmt=TRIM(SchWFmt)//','//TRIM(ValidDayTypes(Count))
ENDDO
SchWFmt=TRIM(SchWFmt)//"')"
WRITE(OutputFileInits,SchWFmt)
WRITE(OutputFileInits,SchSFmt)
DO Count=1,NumScheduleTypes
IF (ScheduleType(Count)%Limited) THEN
YesNo1='Yes'
Num1=RoundSigDigits(ScheduleType(Count)%Minimum,2)
Num1=ADJUSTL(Num1)
Num2=RoundSigDigits(ScheduleType(Count)%Maximum,2)
Num2=ADJUSTL(Num2)
IF (ScheduleType(Count)%IsReal) THEN
YesNo2='Yes'
ELSE
YesNo2='No'
WRITE(Num1,*) INT(ScheduleType(Count)%Minimum)
Num1=ADJUSTL(Num1)
WRITE(Num2,*) INT(ScheduleType(Count)%Maximum)
Num2=ADJUSTL(Num2)
ENDIF
ELSE
YesNo1='No'
Num1='N/A'
Num2='N/A'
YesNo2='N/A'
ENDIF
WRITE(OutputFileInits,SchTFmtdata) TRIM(ScheduleType(Count)%Name),TRIM(YesNo1),TRIM(Num1),TRIM(Num2),TRIM(YesNo2)
ENDDO
! WRITE(Num1,*) NumOfTimeStepInHour*24
! Num1=ADJUSTL(Num1)
! SchDFmtdata=TRIM(SchDFmtdata)//TRIM(Num1)//"(',',A))"
DO Count=1,NumDaySchedules
IF (DaySchedule(Count)%IntervalInterpolated) THEN
YesNo1='Yes'
ELSE
YesNo1='No'
ENDIF
DO Hr=1,24
DO TS=1,NumOfTimeStepInHour
RoundTSValue(Hr,TS)=RoundSigDigits(DaySchedule(Count)%TSValue(Hr,TS),2)
ENDDO
ENDDO
IF (LevelOfDetail == 1) THEN
WRITE(OutputFileInits,SchDFmtdata) TRIM(DaySchedule(Count)%Name), &
TRIM(ScheduleType(DaySchedule(Count)%ScheduleTypePtr)%Name),TRIM(YesNo1),'Values:', &
(TRIM(RoundTSValue(Hr,NumOfTimeStepInHour)),Hr=1,24)
ELSEIF (LevelOfDetail == 2) THEN
WRITE(OutputFileInits,SchDFmtdata) TRIM(DaySchedule(Count)%Name), &
TRIM(ScheduleType(DaySchedule(Count)%ScheduleTypePtr)%Name),TRIM(YesNo1),'Values:', &
((TRIM(RoundTSValue(Hr,TS)),TS=1,NumOfTimeStepInHour),Hr=1,24)
ENDIF
ENDDO
DO Count=1,NumWeekSchedules
WRITE(OutputFileInits,SchWFmtdata) TRIM(WeekSchedule(Count)%Name), &
(TRIM(DaySchedule(WeekSchedule(Count)%DaySchedulePointer(NumF))%Name),NumF=1,MaxDayTypes)
ENDDO
DO Count=1,NumSchedules
NumF=1
WRITE(OutputFileInits,"('Schedule,',A,',',A)",ADVANCE='No') TRIM(Schedule(Count)%Name), &
TRIM(ScheduleType(Schedule(Count)%ScheduleTypePtr)%Name)
DO WHILE (NumF <= 366)
TS=Schedule(Count)%WeekSchedulePointer(NumF)
DO WHILE (Schedule(Count)%WeekSchedulePointer(NumF) == TS .and. NumF <= 366)
IF (NumF == 366) THEN
CALL InvJulianDay(NumF,PMon,PDay,1)
WRITE(OutputFileInits,ThruFmt,ADVANCE='No') TRIM(Months(PMon)),PDay, &
TRIM(WeekSchedule(TS)%Name)
ENDIF
NumF=NumF+1
IF (NumF > 366) EXIT ! compound If might have a problem unless this included.
ENDDO
IF (NumF <= 366) THEN
CALL InvJulianDay(NumF-1,PMon,PDay,1)
WRITE(OutputFileInits,ThruFmt,ADVANCE='No') TRIM(Months(PMon)),PDay, &
TRIM(WeekSchedule(TS)%Name)
ENDIF
ENDDO
WRITE(OutputFileInits,'(1X)')
ENDDO
CASE(3)
DO Count=1,NumSchedules
WRITE(OutputFileDebug,'(A)') ' '
WRITE(OutputFileDebug,'(A)') ' Schedule:Compact,'
WRITE(OutputFileDebug,'(A)') ' '//TRIM(Schedule(Count)%Name)//', !- Name'
WRITE(OutputFileDebug,'(A)') ' '//TRIM(ScheduleType(Schedule(Count)%ScheduleTypePtr)%Name)// &
', !- ScheduleTypeLimits'
NumF=1
DO WHILE (NumF <= 366)
TS=Schedule(Count)%WeekSchedulePointer(NumF)
DO WHILE (Schedule(Count)%WeekSchedulePointer(NumF) == TS .and. NumF <= 366)
IF (NumF == 366) THEN
CALL InvJulianDay(NumF,PMon,PDay,1)
WRITE(OutputFileDebug,'(A)') ' Through: '//TRIM(RoundSigDigits(PMon))// &
'/'//TRIM(RoundSigDigits(PDay))//','
iDayP=0
DO DT=2,6
WRITE(OutputFileDebug,'(A)') ' For: '//TRIM(ValidDayTypes(DT))//','
iWeek=Schedule(Count)%WeekSchedulePointer(NumF-1)
iDay=WeekSchedule(iWeek)%DaySchedulePointer(DT)
if (iDay /= iDayP) then
DO Hr=1,24
WRITE(OutputFileDebug,'(A)') ' Until: '//TRIM(RoundSigDigits(Hr))//':'// &
TRIM(ShowMinute(NumOfTimeStepInHour))//','// &
TRIM(RoundSigDigits(DaySchedule(iDay)%TSValue(Hr,NumOfTimeStepInHour),2))//','
ENDDO
else
WRITE(OutputFileDebug,'(A)') ' Same as previous'
endif
iDayP=iDay
ENDDO
DT=1
WRITE(OutputFileDebug,'(A)') ' For: '//TRIM(ValidDayTypes(DT))//','
iWeek=Schedule(Count)%WeekSchedulePointer(NumF-1)
iDay=WeekSchedule(iWeek)%DaySchedulePointer(DT)
if (iDay /= iDayP) then
DO Hr=1,24
WRITE(OutputFileDebug,'(A)') ' Until: '//TRIM(RoundSigDigits(Hr))//':'// &
TRIM(ShowMinute(NumOfTimeStepInHour))//','// &
TRIM(RoundSigDigits(DaySchedule(iDay)%TSValue(Hr,NumOfTimeStepInHour),2))//','
ENDDO
else
WRITE(OutputFileDebug,'(A)') ' Same as previous'
endif
iDayP=iDay
DO DT=7,MaxDayTypes
WRITE(OutputFileDebug,'(A)') ' For: '//TRIM(ValidDayTypes(DT))//','
iWeek=Schedule(Count)%WeekSchedulePointer(NumF-1)
iDay=WeekSchedule(iWeek)%DaySchedulePointer(DT)
if (iDay /= iDayP) then
DO Hr=1,24
WRITE(OutputFileDebug,'(A)') ' Until: '//TRIM(RoundSigDigits(Hr))//':'// &
TRIM(ShowMinute(NumOfTimeStepInHour))//','// &
TRIM(RoundSigDigits(DaySchedule(iDay)%TSValue(Hr,NumOfTimeStepInHour),2))//','
ENDDO
else
WRITE(OutputFileDebug,'(A)') ' Same as previous'
endif
iDayP=iDay
ENDDO
ENDIF
NumF=NumF+1
IF (NumF > 366) EXIT ! compound If might have a problem unless this included.
ENDDO
IF (NumF <= 366) THEN
CALL InvJulianDay(NumF-1,PMon,PDay,1)
WRITE(OutputFileDebug,'(A)') ' Through: '//TRIM(RoundSigDigits(PMon))// &
'/'//TRIM(RoundSigDigits(PDay))//','
iDayP=0
DO DT=2,6
WRITE(OutputFileDebug,'(A)') ' For: '//TRIM(ValidDayTypes(DT))//','
iWeek=Schedule(Count)%WeekSchedulePointer(NumF-1)
iDay=WeekSchedule(iWeek)%DaySchedulePointer(DT)
if (iDay /= iDayP) then
DO Hr=1,24
WRITE(OutputFileDebug,'(A)') ' Until: '//TRIM(RoundSigDigits(Hr))//':'// &
TRIM(ShowMinute(NumOfTimeStepInHour))//','// &
TRIM(RoundSigDigits(DaySchedule(iDay)%TSValue(Hr,NumOfTimeStepInHour),2))//','
ENDDO
else
WRITE(OutputFileDebug,'(A)') ' Same as previous'
endif
iDayP=iDay
ENDDO
DT=1
WRITE(OutputFileDebug,'(A)') ' For: '//TRIM(ValidDayTypes(DT))//','
iWeek=Schedule(Count)%WeekSchedulePointer(NumF-1)
iDay=WeekSchedule(iWeek)%DaySchedulePointer(DT)
if (iDay /= iDayP) then
DO Hr=1,24
WRITE(OutputFileDebug,'(A)') ' Until: '//TRIM(RoundSigDigits(Hr))//':'// &
TRIM(ShowMinute(NumOfTimeStepInHour))//','// &
TRIM(RoundSigDigits(DaySchedule(iDay)%TSValue(Hr,NumOfTimeStepInHour),2))//','
ENDDO
else
WRITE(OutputFileDebug,'(A)') ' Same as previous'
endif
iDayP=iDay
DO DT=7,MaxDayTypes
WRITE(OutputFileDebug,'(A)') ' For: '//TRIM(ValidDayTypes(DT))//','
iWeek=Schedule(Count)%WeekSchedulePointer(NumF-1)
iDay=WeekSchedule(iWeek)%DaySchedulePointer(DT)
if (iDay /= iDayP) then
DO Hr=1,24
WRITE(OutputFileDebug,'(A)') ' Until: '//TRIM(RoundSigDigits(Hr))//':'// &
TRIM(ShowMinute(NumOfTimeStepInHour))//','// &
TRIM(RoundSigDigits(DaySchedule(iDay)%TSValue(Hr,NumOfTimeStepInHour),2))//','
ENDDO
else
WRITE(OutputFileDebug,'(A)') ' Same as previous'
endif
iDayP=iDay
ENDDO
ENDIF
ENDDO
ENDDO
CASE DEFAULT
END SELECT
DEALLOCATE(ShowMinute)
DEALLOCATE(TimeHHMM)
DEALLOCATE(RoundTSValue)
RETURN
END SUBROUTINE ReportScheduleDetails