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 | |||
logical, | intent(in) | :: | ProcessHeader |
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 OpenEPlusWeatherFile(ErrorsFound,ProcessHeader)
! SUBROUTINE INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN June 1999
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine opens the EnergyPlus Weather File (in.epw) and processes
! the initial header records.
! METHODOLOGY EMPLOYED:
! List directed reads, as possible.
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: MakeUPPERCase
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(INOUT) :: ErrorsFound ! Will be set to true if errors found
LOGICAL, INTENT(IN) :: ProcessHeader ! Set to true when headers should be processed (rather than just read)
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: AFormat="(A)"
CHARACTER(len=*), PARAMETER, DIMENSION(8) :: Header=(/"LOCATION ","DESIGN CONDITIONS ", &
"TYPICAL/EXTREME PERIODS ","GROUND TEMPERATURES ", &
"HOLIDAYS/DAYLIGHT SAVING","COMMENTS 1 ", &
"COMMENTS 2 ","DATA PERIODS "/)
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER GetNewUnitNumber
INTEGER Pos
CHARACTER(len=800) Line
integer HdPos,HdLine
logical StillLooking
integer endcol
integer, external :: FindNonSpace
LOGICAL EPWOpen
integer :: unitnumber
INQUIRE(FILE='in.epw',NUMBER=unitnumber,OPENED=EPWOpen)
IF (EPWOpen) CLOSE(unitnumber)
WeatherFileUnitNumber=GetNewUnitNumber()
OPEN(WeatherFileUnitNumber,File='in.epw',ERR=9999,action='read')
IF (ProcessHeader) THEN
! Read in Header Information
! Headers should come in order
HdLine=1 ! Look for first Header
StillLooking=.true.
DO WHILE (StillLooking)
READ(WeatherFileUnitNumber,AFormat,END=9998) line
endcol=LEN_TRIM(line)
IF (endcol > 0) THEN
IF (ICHAR(line(endcol:endcol)) == iASCII_CR) THEN
StripCR=.true.
line(endcol:endcol)=Blank
ENDIF
IF (ICHAR(line(endcol:endcol)) == iUnicode_end) THEN
GOTO 9997
ENDIF
ENDIF
Pos=FindNonSpace(line)
HdPos=INDEX(line,TRIM(Header(HdLine)))
IF (Pos /= HdPos) CYCLE
! line=MakeUPPERCase(line)
CALL ProcessEPWHeader(Header(HdLine),line,ErrorsFound)
HdLine=HdLine+1
IF (HdLine == 9) StillLooking=.false.
ENDDO
ELSE ! Header already processed, just read
CALL SkipEPLusWFHeader
ENDIF
RETURN
9997 CALL ShowSevereError('OpenWeatherFile: EPW Weather File appears to be a Unicode or binary file.',OutputFileStandard)
CALL ShowContinueError('...This file cannot be read by this program. Please save as PC or Unix file and try again')
CALL ShowFatalError('Program terminates due to previous condition.')
9998 CALL ShowFatalError('OpenWeatherFile: Unexpected End-of-File on EPW Weather file, '// &
'while reading header information, looking for header='// &
TRIM(Header(HdLine)),OutputFileStandard)
9999 CALL ShowFatalError('OpenWeatherFile: Could not OPEN EPW Weather File',OutputFileStandard)
RETURN
END SUBROUTINE OpenEPlusWeatherFile